Linux command ls

Define the
ls command to display the list of file directories, this command is relatively simple, pay attention to the meaning of each parameter

The main parameter (personally think)
-a stands for all, can display all files, that is, it can also display hidden files starting with.
-R stands for reverse, display the sorting results in reverse order
-t Sort according to the last modification time, Generally used in conjunction
with -r -l displays the information attributes of the file in long format
-R lists all recursive subdirectories
-i lists the inodes of the files
-U displays without sorting, when the number of files is large, it is used in conjunction with filtering more
-h column Output file size
-S List files from largest to smallest

The collocation I often use is
ls -U|grep -i "XXXX" filter out the results I want without sorting
ls -lrt flashback display, you can directly see the latest log
ls -l generally we like to use alias ll='ls -l' alias to simplify, because there are too many
ls -Sl lists the files from large to small
.
The ls command of Linux is equivalent to double-clicking a directory under windows. Generally, there is no problem. I think it just needs to pay attention. Two points:
(1.) If there are too many files under a directory, the order of magnitude reaches hundreds of thousands to millions, then you will usually die when you go to ls, so you need to pay attention to how many files are in the directory you listed;
(2 .) When the execution of the ls command is killed, you need to look at the virtual memory setting. When accidentally set to 0, the result is that the executed command is immediately killed.

Guess you like

Origin blog.51cto.com/15013163/2553561
Recommended