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.
Asked
Active
Viewed 73 times
0
1 Answers
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 -1is 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
-1(digit "one") with-l(letter "ell") – steeldriver Sep 28 '21 at 12:17ls. Seeman lsor more generally, check How can I get help on terminal commands? – pLumo Sep 28 '21 at 12:19