Fundamentals of the ten-year OPS series-Linux
Zeng Lin
Contact: [Email protected]
Website: www.jplatformx.com
Copyright: Please do not reprint the article without permission
First, Introduction
Under normal circumstances, Linux commands themselves are not complex, after all, Linux lineage is the philosophy of Unix culture, so-called less are more. Linux commands are really hard to be the options and parameters in the command. Let's take a general look at how most of the commands under Linux work. Typically, commands are followed by one or more options, and commands with different options do not function the same. In addition, the command is followed by one or more parameters, which are the objects that the command acts on. So most of the commands look like this:
command-options Arguments
Most commands use the option to precede a single character with a hyphen, such as-L. However, many commands, including those in the GNU project, also support long options with two hyphens in front of the word, such as--help. Also, many commands allow multiple short option strings to be used together, such as LS-LT. -L is displayed in a long format, and the-t display is displayed in reverse chronological order.
Second, ls command
The LS command functions as a list directory contents. According to the above command itself is not difficult to understand, difficult is the options and parameters. The following is a list of common options for the LS command, and it is sufficient to remember these commonly used options in your work.
Options |
Long options |
Meaning |
-A |
--all |
Lists all files, including files that begin with. Hidden files are not listed by default |
-D |
--directory |
Typically, if you specify a directory, the LS command lists the contents of the directory rather than the directory itself. Use this option in conjunction with the-l option to view the details of the directory, not the contents of the directory |
-F |
--classify |
The option adds a type indicator after each listed name (for example, if the name is a directory, a slash is added) |
-H |
--human-readable |
Listed in long format, displaying the size of a file in a human-readable manner rather than as a number of bytes |
-L |
|
Make long format display results |
-R |
--reverse |
Displays the results in reverse order. Normally, the LS command displays results in ascending alphabetical order |
-S |
|
Sort results by File size |
-T |
|
Sort by modified time |
(001) LS for linux command-line commands