0

When I run ls -1 filename, it just lists the filename, instead of permissions with filename. However, according to online resources, the output should also have permissions details of the file. I used stat and that worked.

Kulfy
  • 17,696
svyslf
  • 3
  • 1

1 Answers1

3

-1 is a parameter to ls command that tells the command to list only filenames, one file per line (by default ls with no parameter lists as many filenames in a line as will fit in line width). So your command does exactly what it should.

If you want to list permissions and other data about files, you should use -l (for long), not -1.

raj
  • 10,353
  • It should be noted here that ls -1 is really good for scripts, where you want to list all filenames only, do some filtering, and end up with a smaller list of names that can be read into an array etc. – Artur Meinild Sep 28 '21 at 16:42