Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 ?
share|improve this question

migrated from stackoverflow.com Sep 16 '12 at 13:01

This question came from our site for professional and enthusiast programmers.

3 Answers 3

up vote 2 down vote accepted

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.

share|improve this answer
    
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 '12 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. –  Kevin Johnson Sep 15 '12 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. –  Kevin Johnson Sep 15 '12 at 20:54
    
Both answers Lipongo and Kevin are clear and very good. Thank you both! –  Narcís Sep 16 '12 at 8:43

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.

share|improve this answer
    
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 '12 at 16:31
    
type man ls not man ls -la. –  Lipongo Sep 15 '12 at 16:50
  • -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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.