Linux ls command operation example summary

  
                

We all know that the ls command is mainly used to display the contents of the current directory. It is a commonly used command under Linux. Today, Xiaobian mainly introduces you to the Linux ls command instance, I hope to help you.

What is ls

The ls command is used to list files and directories. By default, he will list the contents of the current directory. With the parameters, we can do more with ls (see the system home ls command in Linux operation?). Here are some examples of ls usage used in everyday operations.

1. run with no arguments ls

run ls with no arguments will list only the file or directory. I can't see other information output. (Annotation: Sometimes you find that the ls command with no parameters is different from the one described here, it may be that your ls command actually has the ls alias with parameters).

$ ls

2. Use a long list mode

Use the -l characters (lowercase L character), will show a long list of the contents of the current directory. In the next example, we will combine the -l parameter (this parameter is often used) to get better results.

$ ls -l
Previous1234567Next page Total 7 pages

Copyright © Windows knowledge All Rights Reserved