ls unix command not working

조회 수: 16 (최근 30일)
Jeffrey Scott
Jeffrey Scott 2011년 12월 7일
When I type 'ls' in the command window, I receive the following:
??? Error using ==> ls at 36
The result of running [s l] = unix('ls')
is
s= 127
l = ''
'ls' works in terminal and I can use commands like 'cd' and 'pwd' in the matlab command window but not 'ls' for some reason. I'm using 2010b running on OSX 10.6.7

답변 (2개)

Jason Ross
Jason Ross 2011년 12월 7일
Try
system('which ls')
to see if ls actually shows something.
You might need to do
system('/bin/ls')
or otherwise modify your system if it's not picking up "ls" (which I'd expect to be available)

Dr. Seis
Dr. Seis 2011년 12월 7일
You can use "dir" instead

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by