Score:0

Why do `ls -1 filename` just lists the filename?

cx flag

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.

hr flag
You're confusing `-1` (digit "one") with `-l` (letter "ell")
David avatar
cn flag
You need to be clear are the files on a windows 10 drive?
pLumo avatar
in flag
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)
svyslf avatar
cx flag
Ahhhh yeah i was confusing it with 1 instead of l. ahahahaha funny. Thank you all for your help!
Score:3
cn flag
raj

-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.

Artur Meinild avatar
vn flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.