In my current directory, I execute the command:
ls -1
and it gives a list of the current directory contents.
In the same directory, I repeat the command: ls
and it gives me the same result, with perhaps a different formatted output.
Finally, I try to find out about the available commands by typing ls --help
and the output is:
usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]
It looks like the last option is 1
(#1). Can someone explain what the ls -1
does and how it's different to the standard ls
command?
Best Answer
Yes, the formatting of the output is the only difference between
ls -1
andls
without any options.From the
ls
manual on my system:This is also a POSIX option to the
ls
utility.The manual for
ls
on your system is bound to say something similar (seeman ls
).Related: