Linux Common Command Summary--command basics

Source: Internet
Author: User

Some people feel that the Linux command line operation is a very mysterious and difficult thing, in fact, as long as we calm down to understand the basic knowledge of Linux command-line operations, we will find that command-line operation is not as difficult as expected. The features of the command line operation can be summed up in four words "simple and efficient". It takes only one or two commands to perform dozens of mouse clicks in the graphical interface. Before we learn the specific commands, we need to master the basic knowledge of the command, mastering these, learning commands is a very simple thing.

The Linux command uses the format :

command [options] [parameters]

Use spaces between commands, options, and parameters.

Options: The specific function used to adjust the command.

Short format options: Boot with "-" followed by a single character. such as "-a", "-l", multiple short format options can be abbreviated together, such as "-a-l" can be abbreviated as "-al".

Long format options: Guided by "--", followed by more than one character, usually a word or a word abbreviation. such as "--color".

Parameters: The object that the command operates on.


Linux Command Categories :

Internal (built-in) command: commands that accompany the command interpreter (shell) itself

External command: Executable file stored in path

How can I tell if a command is an internal command or an external command?

Type Command

[[Email protected] ~]# type pwdpwd is a shell builtin # # # # "PWD" is a shell built-in command, if the output of similar content, indicating that the command is internal command [[email PR Otected] ~]# type Lsls is aliased to ' ls--color=auto ' # # # "LS" is the alias of "LS--collor=auto" command, if the output is similar, it means that the command is an external command (about command aliases, after Continuation of the discussion)

ways to get help with Linux commands :

Internal Command :

Help command

[email protected] ~]# help pwdpwd:pwd [-LP] Print the name of the current working directory. Options:-lprint The value of $PWD if it names the current working Directory-pprint the physical directory, Without any symbolic links ....

external Command :

Command --help

[[email protected] ~]# ls--help usage: ls [options] ... [File] ... Lists the FILE information (default is the current directory). If you do not specify the-cftuvsux or--sort option, sort by letter size.  The long option must use parameters that are also required for short options. -A,--all does not hide anything. Start Project-A,--almost-all list except. And: Any project other than ....

Command User manual . The above method can be used to get a command, but not detailed enough, if you need to get command more detailed information, you can use the "man" command to read the command manual

Man [n] command

N: Manual chapters, different sections corresponding to different types of information, omit this option from 1-8 in order to automatically match, if you need to see a chapter, you can use the corresponding number to specify the view of a chapter

1: User command (/bin,/usr/bin,/usr/local/bin)

2: System call

3: library Call

4: Special files (device files)

5: File Format (explains how the configuration file is used)

6: Game

7: Miscellaneous (content that is not categorized) (miscellaneous)

8: Administrative commands (commands used by administrators) (/sbin,/usr/sbin,/usr/local/sbin)

[[email protected] ~]# man ls        ### Interactive reading mode is entered after executing the command LS (1)                              User Commands                             ls (1) name                 ## #命令简要说明        ls -  list directory contentssynopsis             ## #使用方法 ("[]" section can be omitted; "..." means that multiple can occur; "<>" means must be filled; "|" means multiple select "{}" for grouping, no special meaning        ls [option]... [file] ... description         ## #命令功能详细描述 (contains a detailed functional description of the command options)        list  information  about the files  (The  current directory by default) .  sort        entries alphabetically if none of -cftuvsux nor --sort.        Mandatory arguments to long options are mandatory  for short options too.       -a, --all               do not ignore entries  starting with .       -A, --almost-all               do not list implied &NBSP;.&NBSP;AND&NBSP, ..... reporting bugs      ## #如何提交BUGS         Report ls bugs to [email protected]       gnu  Coreutils home page: 

How to use the man command interactive reading mode:

Flip screen: "Space" to turn back screen; "B" Flip the screen forward

Turn the line: "Enter" to turn backwards; "K" To turn forward.

Find: "/keyword" from the previous lookup keyword "keyword" ("N" key to find the next; "N" to find the previous)

”? keyword"Find the key from the back forward in"keyword"(" N "key to find the next;" N "to find the previous)

Exit: "Q"

If you want to learn more about the features of a command, the history of commands, and other information about the command, you can use the "info" command to view the relevant information

Info Command

[Email protected] ~]# info lsFile:coreutils.info, node:ls invocation, next:dir invocation, Up:directory listing10. 1 ' ls ': List directory contents==================================the ' ls ' program lists information on files (of any Ty  PE, includingdirectories). Options and file arguments can be intermixedarbitrarily, as usual .....

Info command How to use interactive reading mode:

Flip screen: "Page Down" back screen; "Page Up" to flip the screen forward

Flip line: Up and down cursor keys

Exit: "Q"

This article is from the "Blackart" blog, make sure to keep this source http://blackart.blog.51cto.com/1142352/1416666

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.