Common Linux Command Summary 2

man command

man command help command under Linux, you can view the Linux instructions in the Help, help, and configuration file programming help and other information through the man command.

man + need instruction queries.

 

free command

free command displays memory usage, including physical memory, virtual memory swap files, shared memory segments, core and buffer systems used. Common parameters are:

-b to Byte Displays memory usage.

-k in KB display memory usage.

-m in MB display memory usage.

-o not display buffer adjustment column.

-s < interval seconds> memory usage is continuously observed.

-t display memory column sums.

-V Display version information.

 

who command

 

 who command displays information about all current users on the local system. Shows the following: login name, tty, login date and time.

who command can also display line activity occurred since the elapsed time, process the command interpreter (shell) logo, logon, logoff, reboot and change the system clock, but also display other processes generated by the initialization process.

 

pwd command

pwdIs Print Working Directoryan abbreviation, its function is to display the full path to the current working directory is located. When uncertainty is mainly used in the current location, by pwdviewing the current directory to the absolute path.

 

mkdir command and command rmdir

 Respectively, to create the directory and delete directories.

 

su command

 su command is used to change the identity of other users, except root, need to type the user's password.

 

Implementation creates a user with root privileges, delete and modify the password

Suppose we now create the user named testuser

Create a user useradd testuser testuser
passwd testuser testuser user to set a password has been created
Description: The newly created user creates a user directory under testuser / Home
the usermod modify user --help This parameter associated command
userdel testuser delete user testuser
RM -rf testuser testuser delete user directory

If you do not know what the user is created in place to find a locate useradd.

 

 

tar command

tar command is used to package a file compression or decompression, the format is: "tar [options] [file]."

Packaged and compressed files: "tar -czvf name .tar.gz archive file name"

Decompress and expand the archive: "tar -xzvf archive name .tar.gz"

parameter

effect

-c

Create a compressed file

-x

Extract the file

-t

There are those who view compressed files in the package

-with

With Gzip compression or decompression

-j

Compression or decompression with bzip2

-v

Display compression or decompression process

-f

The destination file name

-p

Preserve the original permissions and attributes

-P

Use an absolute path to compress

-C

Specify the directory to unzip

 

grep command

 

grep command to search for text in the format: "grep [options] [file]."

 

Search for a keyword: "grep keyword text file"

 

parameter

effect

-b

The executable (binary) as a text file (text) to search

-c

Only to find the number of display

-i

Ignore case

-n

Show Line Numbers

-v

Invert Selection - lists only the bank did not "keyword" of.

 

 

history command

And instructions for displaying the history of executed commands. reads the command history command history file directory to history and the history command buffer directory command buffer write command file.

 

wc command

Using the wc command we can calculate the number of files Byte, word, or the number of columns, without specifying the file name or file name is given, "-", the wc command to read data from the standard input device will be. Common parameters are as follows:

  • -c or --bytes or --chars show only a few Bytes.
  • -l or --lines show only the number of rows.
  • -w or --words display only words.
  • --help online help.
  • --version display version information.

 

find command

find command to find the file in the specified directory. Any string parameters located before will be considered directory name you want to find. If you use this command does not set any parameters, the find command will find subdirectories and files in the current directory. And will look into all the subdirectories and files are displayed.

 

Guess you like

Origin www.cnblogs.com/fairyting/p/11706697.html