Novice needs to grasp the command

Novice needs to grasp the command

table of Contents

Original link: https://www.linuxprobe.com/chapter-02.html

First, the common work order system 

Second, the system state detection command 

Third, the working directory command 

Fourth, the text file editing commands 

Fifth, the file directory management commands 

Six pack compression and search command 

Seven Questions and Answers 

 

First, the common work order system

. 1 , echo command output value after the interruption of the extraction string or variable

The specified string ' Linuxprobe.com ' is output to the terminal screen

 

Use $ variable manner extracted variable SHELL value, which is output to the screen

 

2 , DATE command for displaying the date and time or set the system in the format of " DATE " [ options] [ + specified format]

 View the current system time according to the default format.

  

"Press On - month - : min: sec hour day " format view the current system time.

 

date command parameters % j can be used to view today is the first day of the year.

   

 

3 , reboot command, used to restart the system, [no actual implementation, because a lot of open service].

 

 

. 4 , wget command file for downloading a network terminal, the format of "wget [ Parameters Download ."

   wget parameters and functions of command

   -b: background download mode

   -P: downloaded to the specified directory

   -t: maximum number of attempts

   -c: HTTP

   -p: download all the resources page, including pictures, screen, etc.

   -r: recursive downloads

 

5 , PS commands: View the status of the system used to process the format " PS Parameters."

   ps parameters and the role of command

   -a: show all processes

-u : user and other details

-x: display process without a controlling terminal

 

  

6 , Top command: for information to dynamically monitor process activity and system load, the format top, you can see the dynamic state of the system operation and maintenance.

 

The first 1 line: the system time, run time, login number of terminals, the system load.

The first 2 lines: Total number of processes, the number of running processes, number of processes during sleep, stopping the process, the number of dead in the process.

The first 3 lines: the percentage of resources occupied by the user, the system kernel resources occupancy percentage, percentage change over resources, such as the percentage of idle resources priority process.

The first 4 lines: total physical memory, memory usage, the amount of free memory, the amount of kernel memory as cache.

The first 5 lines: total amount of virtual memory, virtual memory usage, virtual memory free amount, the amount of memory that has been loaded in advance.

 

 

7 , pidof command: query for a specified service process PID value in the format of " pidof Parameter name] [service]."

  Checks the local sshd service program PID:

 

 

8 , the kill command: to terminate a specified PID service process in the format of " the kill Parameter process [ PID ]."

 The pidof sshd found out [of the process to terminate Do not try to service the whole ball off]

 

 

Second, the system state detection command

. 1 , the ifconfig: for acquiring the network card configuration and status information, the format " the ifconfig" [] Parameters network device.

 

 

 

 

2, uname command: to view the system kernel and system version and other information, in the format of " uname [-a]."

 

 

 

 

3, Uptime command: used to view the system load information in the format of uptime.

 

 

4, free command: displays the current system memory usage information, the format of " Free [-H]."

 

 

 

 

5, who command: to view the current logged in user host terminal information, the format of 'who [ Parameters.

 

 

 

 

6, last command: Log in to view records of all systems in the format " Last Parameters."

 

 

 

  

7, history Command: Command history have been executed for display.

 

 

 

 

8, sosreport command: used to collect system configuration and schema information and diagnostic output document format sosreport.

 

 

 

 

Third, the working directory command

1, pwd command: which is used to display the user's current working directory.

 

 

 

 

2, cd command: Change the working directory for the format " cd [ directory name] ."

  

The other would add:

Cd ..: go back one level

Cd ../ ..: return on two directories

 

3, ls command: file directory information for display in the format of " LS [options] [file]"

 

 

 

 

If you want to view a directory attribute information, you need to add an additional -d parameter.

 

 

 

 

Fourth, the text file editing commands

1, cat command: To view a plain text file, the format is " CAT [options] [file]"

 

 

 

 

2, more commands: To view a plain text file, the format is " More [options] file."

 

 

 

 

3, head command: plain text documents for viewing before the N line in the format of " head [options] [file]."

 View first 10 rows

 

 

 

 

4, tail command: for viewing text documents after the N line or continue to refresh the content in the format of " tail [options] [file]."

After a review of 10 lines

 

 

 

 

5 , TR command: used to replace characters in a text file, the format is " TR [original character] [target] character."

 

 

 

 

6 , WC command: statistics for the specified number of lines of text, word count, the number of bytes in the format of " WC Parameters text"

 

 

7, stat command: used to store specific information and time to review documents and other information, in the format " STAT file name."

 

 

 

 

8, cut command: used by the 'column' extract text characters, the format of " Cut Parameters text."

 

9 , diff command: diff for multiple text files in the format of "diff [ parameters] files ."

 

Fifth, the file directory management commands

1, touch command: Time used to create a blank file or set of files in the format of "touch [options] [file] ."

   -a: Modify only "access time" (atime)

   -m : Modify only "modification time" (mtime)

   -d: also modify the atime and mtime

 

 

 

 

2, mv command: used to cut the file or rename the file, the format is "mv [ options] source [destination path | destination file name] ."

 

 

 

 

3, file command: type is used to view files in the format of "file filename ."

 

 

 

 

 Six pack compression and search command

1 , tar was originally just a packaging tool, but also the realization of a 7Z , gzip , the xz , bZIP support tools, tar decompression and compression commands are the same, only different parameters.

Create a tar package.

    

The above command, -c represents the creation of a tar package file, -f for the file name of the created note that the file name must immediately -f after the argument.

 

2, grep command: used to perform a search keyword in the text, and display the results match the format of "grep [options] [file] ."

 -n: to display the search to line number information.

 -v : information for anti-election

 

 

 

 

3, find command is: find the conditions for the specified file, the format of "find [] search path hunt operation condition tie "

   Get all the directory to host a list of files that begin with.

 

 

 

 

If you want to include in the search throughout the system permissions SUID all file permissions, just use -4000 can be.

 

 

Seven Questions and Answers

1, please write with echo command to SHEL command variable value is output to the screen of the terminal

  echo $SHELL

2, briefly linux system 5 names and meanings kinds of processes

 

3, try to use linux command to close the PID for the 5529 service process

   Kill 5529

4, using the ifconfig command to view network status information, it is important to see the 4 entries, respectively, what is?

 The main view is the name of the NIC, inet behind parameters IP address, ether network card physical address parameters of the back, the RX \ the TX number and total flow rate and receiving packet data in transmission packets.

5, using the history command to view the execution history recording command, the command in front of the digital addition to ordering what is the use?

You can also use the "! Digital" command format repeated execution of a command once recorded, thus avoiding having to type long commands

 

6 file if you want to have a long view of content, then use the CAT , More , head , tail in which command appropriate?

more

7, using mkdir when you create a directory has nested relationship of command, what parameters should be added to it?

-p

8, using rm When you delete a file or directory commands, which can be used to avoid secondary parameters confirm it?

 rm -rf

9, if called backup.tar.gz archive file, unzip command what should be?

takes -zxvf backup.tar.gz

10, using grep when a file keyword search command, if you want to perform file contents anti-election, what parameters should use?

-v

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/dxw-dong/p/11759959.html