The LS command is the most common command for Linux virtual machines, and LS is the abbreviation for list, which is used to display the contents of the specified working directory.
First, the syntax of the next LS command is explained
[-Alrtafr][name...]
In fact, LS [option] [directory name]
Next introduce the LS command basic common usage and function.
Basic output
LS outputs the file name and directory name in the current directory. It is important to note that the output at this time does not contain hidden files and hidden directories. Here the file begins with a in the first one.
Ls-r the file in reverse order (originally in alphabetical order) and contrast. So the file at the beginning of W is in the first one.
LS-T lists the documents in the order in which they were established. Compared with.
Show hidden files
LS-A displays all files and directories (LS default starts the filename or directory name as ".") As hidden files, are not listed) and are compared. The Linux command has a different case meaning, if you use-a, the output is the same, but the "." is not listed. (current directory) and ".." (Parent directory)
Show files More information
Ls-l In addition to the file name, the file type, permissions, owner, file size and other information are listed in detail.
Differentiate Files directory
Ls-f adds a symbol after the name of the file listed. For example, the executable file is added "*" and the Directory is "/". can be used to distinguish between directories and files
Wildcard characters
This is only a description *
This will output all files in the file that begin with D.
Before LS is executed, * has been replaced with a specific document.
This is equivalent to executing LS DDh.txt Desktop Documents Downloads.
The default does not match the hidden file, even if the A option is specified.
So at this point, you want to output the. Number that the hidden file must specify.
The-D function here is to not display its subdirectories.
You can export all the directories here.
This shows all the directories in reverse order.
Wildcard usage Many think, different combinations can achieve a variety of purposes.
Summarize
ls command is seemingly simple, but the function is very powerful command, in addition to the introduction of these common usage, but there are still many, here is not a narrative, let's explore it.
Share Linux Command-ls command