Some understanding of linux command

Ctrl + S   to stop scrolling; press Ctrl + Q key recovery scrolling
Ctrl + c acts to terminate the current execution of the program from the command line,

Ctrl + d   is equivalent to the exit command to exit the current shell

Clear screen clear or Ctrl + l

 

/ Root directory

cd      Change directory

cd .. parent directory

cd ~    return to the root directory ( / the root)

 

ls List directory 

-a: All files, together with (The file begins with the) hidden files are listed along to -d: list only the directory itself, rather than list the files in the directory data

-l: long serial data out, it contains the attribute data and file permissions, etc.

 

cat positive sequence read files

-b: lists the line number, line number do only for non-blank line display, blank lines are not marked line number

-n: lists the line number, line number blank lines marked

tac reverse to read the file

 

head displayed at the beginning of ten lines

-n last twenty lines 20 show

 

tail displays the last ten lines

-n last twenty lines 20 show

-f continued to flush the print content

 

less by page to display text, page flip up and down

In less run time can be entered:

/ String: down search "string" (case sensitive)

? String: up search 'string' (case sensitive)

q: Quit less

-m: Displays the current percentage progress page

less may be used pagedown [] and [] pageup key page forward and page, so it looks more convenient.

 

rm command to delete

-rf forcibly remove the specified path will delete all files and directories under the path

-f delete a file

-r Removes the specified directory

 

extract jar or a compression war, jar package

-xvf extract to the directory where the

 

 

 

 

ps Process Viewer

-ef | grep process name to see the processes running path and information (grep characters to find )

 

cp copy

-f overwrites the file, without prompting

-i overwrite the file, prompting

-r will copy all files in the directory

Format cp -i file / new directory

 

mkdir  create a folder

-p sure that the directory name exists, it does not exist to build a

 

Linux output redirection > and >> differences are as follows:

>:   Will overwrite the file, if the file will overwrite the contents inside.

>>   This is the output append to the target file. If the file does not exist, create the file.

>> : Append file, that is, if the contents of a file inside the new content will be appended to the end of the file.

>      Is directed to a file, if the file does not exist, create a file; if the file exists, it will be empty. Generally, when we clean up the backup log file, is this: first backup log, then the `>` will clear the log file (the file size becomes 0 bytes).

 

chmod (chmod permissions management commands change the permissions mode of a file abbreviated )

u behalf of the owner, the X- behalf of the Executive authority. + To add permissions. chmod u + x file.sh says of the current directory file.sh owner of the executable file of the right to increase 

Guess you like

Origin www.cnblogs.com/loftercat/p/11510817.html