0

I'm new in the use of the terminal. I have seen in a video that uses ls -al and I don't know what it is. I have found that ls -a is to list all the files even the hidden but I cannot find what does ls -al means. In the same terminal I write man ls -al and it says man: "invalid option -- l" So:

  • What does ls -al mean ?
  • Where can I this kind of information. Is there any kind of manual or tutorial for very beginners like me ?

3 Answers 3

3

ls lists all the files in a folder

ls -a lists all the files, including hidden files

ls -l lists all the files, in "long format" which basically tells you anything you needed to know about the files

ls -al is a combination of ls -a and ls -l

You can find more information about a command by typing man <command>, ex: man ls will give you more information about ls. To exit man hit q.

4
  • If I type: "man ls -al" I get: "man: invalid option -- l" Anyway, now thanks to you I already know what does it mean. Thank you!
    – Narcís
    Sep 15, 2012 at 16:31
  • @Narcís oh, you can't use the arguments with man, you have to just use the man command and skim through the article to see what the arguments mean. Sep 15, 2012 at 20:52
  • And if this solved your question you might want to mark it as accepted, by clicking the green checkmark next to the answer that helped you most. Sep 15, 2012 at 20:54
  • Both answers Lipongo and Kevin are clear and very good. Thank you both!
    – Narcís
    Sep 16, 2012 at 8:43
1

The command ls is for listing directory contents or file information. The option -a if for listing all files. The option -l means long listing, more detailed information. When you combine them in ls -al you should get the long listing of all files, including hidden files.

If you google "Unix beginner tutorial guide" you should come up with a lot of usable sites to learn from.

From the error you are getting, the - you are placing is not the right kind. This is possibly from copying and pasting the command from elsewhere.

2
  • If I type: "man ls -al" I get: "man: invalid option -- l" Anyway, now thanks to you I already know what does it mean. Thank you!
    – Narcís
    Sep 15, 2012 at 16:31
  • type man ls not man ls -la.
    – Lipongo
    Sep 15, 2012 at 16:50
1
  • -a means include all files, including the current directory, parent directory and files whose names begin with a dot.
  • -l means display in long format.

To find out how the arguments affect the output of a command, use man command to see the documentation for the command. For example, man ls.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .