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,416
  • 26
  • 64
  • 103
svyslf
  • 3
  • 1
  • 3
    You're confusing `-1` (digit "one") with `-l` (letter "ell") – steeldriver Sep 28 '21 at 12:17
  • You need to be clear are the files on a windows 10 drive? – David Sep 28 '21 at 12:18
  • 2
    This is the behavior like stated in the documentation of `ls`. See `man ls` or more generally, check [How can I get help on terminal commands?](https://askubuntu.com/questions/991946/how-can-i-get-help-on-terminal-commands) – pLumo Sep 28 '21 at 12:19
  • Ahhhh yeah i was confusing it with 1 instead of l. ahahahaha funny. Thank you all for your help! – svyslf Sep 28 '21 at 22:42

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
  • 9,367
  • 2
  • 16
  • 42
  • 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