Linux Some instructions and shortcut operations, not regularly updated in ~ ~

Source: Internet
Author: User
Tags aliases clear screen first string parent directory

Command
Alias Unalias. BASHRC (source. BASHRC Reread configuration file)
BaseName only the last filename from the file path
BC Calculator
Clock
-S set the hardware time to system time
-W Set the system time to hardware time
Cal Calendar September 1752 less than 11 days
CD Open Directory (. Current directory: Parent directory)
CHVT Digital Switch Terminal
Command alias \alias alias conflicts after executing the original commands (aliases > Internal commands > External commands)
Cat/etc/centos-release viewing the release version
Cat/proc/meminfo (cpuinfo) memory size (CPU information) <proc directory is only a mapping of memory, not on disk >
Clear Ctrl+l Clear Screen
Date
Date +%s shows the number of seconds from 1970.1.1
Date +%f Displays the current date 2018-03-28
Date +%d 03/28/18
Date + "%F%T" 2018-02-28 20:08:30
Date + "%y/%m/%d%h:%m:%s" 2018/03/28 20:11:06
date-d "2 days Ago" +%a two day ago weeks
Date-d "2 Days" +a two day after week
Date 080706052019.10 Setting dates
Date +%v shows the number of weeks for the ISO standard
DD Convert and copy files, can generate large files to do hardware testing
DF reports the use and mount of disk files in the file system
DirName the last file retention path information from the file path
Du-sh/ The size of the statistics file
Echo
Enable
-N: Closes the specified internal command;
-A: Displays all active internal commands;
-F: Reads internal commands from the specified file.
Fdisk
-L Display partition information
Free Display Memory information
Gedit Graphical text editing tools
Historical command History
Hash
-L Display Cache
-P path name aliases the command full path from path to name but not to alias
-T path to name in print cache
-d name clears the path to name
-R Clear Cache
Hostname Display the host name of the system
Hexdump viewing files in hexadecimal
Help internal command
Info similar to man
ID + user name display user ID information
Init 0 3 5 6 centos6 switch RunLevel
Ifconfig View IP
LL is Ls-l's nickname.
LS/DEV/SDA

Case of LSBLK block equipment
Ltrace View Library
LDd displaying information about shared libraries (full path of LDD + directives)
Logout Exit Ctrl+d Sign Out
Man Display Help document
Makewhatis creating a man's help document
Mandb Centos7 to create help documents
Nano similar to VI vim
Ntpdate IP settings for time synchronization
Poweroff Power off
passwd + user name modify the password of the corresponding user the administrator can modify the password of the normal user
PWD Displays the current path
Rz
RunLevel Display Run level
Reboot reboot (similar to init 6)
Rpm-qa |wc-l to count all packages installed on the system
Touch Create File
TTY display terminal information of user login
The type is used to differentiate between internal directives and external directives, where there is a specific path where the external command has shell builtin information is an internal instruction
Tzselect CENTOS6 for time zone settings, with a sense of interactivity
Timedatectl CENTOS7 Display and time zone setting
StartX runs the graphical interface, but does not change the RunLevel, the graphics in Linux are only used as programs, and the terminal can close the graphic by Ctrl +c
Sz
Sosreport Rhel For information collection and packaging instructions
source. Re-reading the configuration file
Shutdown shut down the machine
Strace View System call
screen does not cause command execution to fail because of a disconnected connection
-S create a new session
-X Third party login with the same user name password and can be remotely manipulated
Ctrl +a D temporarily quits session
Ctrl +a K Close Session
-ls list of sessions that can be joined
-R Recovery session (can be restored in-R after an unrecoverable time with the-D option)
Uname
-R View Kernel
-A view system all information
W Displays the programs that are currently executed by all users
Wall send information to all logged-in users
Who am I displays the current user's terminal information and logon time and IP
Whatis view the paragraph of the Help document for the instruction
Whereis view the path to the help document for the instruction
Which installation path for display instructions
WHOAMI Displays the user name of the current user

repeat the previous command, there are 4 ways
Repeat the previous command using the UP ARROW key, and enter to execute
By!! and enter to execute input!-1 and enter to execute
Press Ctrl+p and enter to execute
!:0 Executes the previous command (remove parameters)
Ctrl + N Displays the next command in the current history, but does not perform
Ctrl + J executes the current command
!n command to execute the history command output corresponding to the ordinal n
!-n executes the last nth command in history

Command line History
!string repeat the previous command that starts with "string"
!? String repeats the previous command containing string
!string:p only prints the command history without performing
!$:p the contents of the PrintOut!$ (last parameter of the previous command)
! :p print out! Contents of (All parameters of the previous command)
^string Delete the first string in the previous command
^string1^string2 Replace the first string1 in the previous command with string2
!:gs/string1/string2 Replace all string1 in the previous command with string2
Use the up and down keys to navigate up and down the previously entered commands
Ctrl-r to search for commands in command history? (Reverse-i-search) ':
Ctrl+g: Exit from History search mode? To recall the last parameter in the previous command
!$ indicates ESC,. (Click ESC and then release and click.) Key) Alt +. (Hold down the ALT key while you click.) Key

Call History parameters
Command!^ parameters that use the first parameter of the previous command to do the cmd
Command!$ the parameters of cmd using the last parameter of the previous command
Command! parameters for cmd with all parameters of the previous command
Command!:n parameters that use the nth parameter of the previous command to do the cmd
Command!n:^ invokes the first argument of the nth command
Command!n:$ invokes the last parameter of the nth command
Command!n:m to invoke the M parameter of the nth command
Command!n:
invokes all parameters of the nth command
Command!string:^ searches the command history for commands that begin with a string and gets its first argument
Command!string:$ searches the command history for commands that begin with a string and gets its last argument
Command!string:n searches the command history for commands beginning with string and obtains its nth argument
Command!string:* searches the command history for commands beginning with string and obtains all of its arguments

Command execution: Add & can be executed in the background, will not occupy the terminal

Bash's shortcut keys
Ctrl + L clear screen, equivalent to clear command
Ctrl + o executes the current command and displays the command again
Ctrl + S block screen output, lock
Ctrl + q allows screen output
Ctrl + C Abort command
Ctrl + z suspend command
Jobs: viewing suspended program numbers
FG + serial number put the suspended program back in the foreground execution
BG + serial number put suspended programs in the background execution
Ctrl + A cursor moves to the beginning of the command, which is equivalent to home
Ctrl + e cursor moves to the end of the command line, equivalent to end
Ctrl + F cursor moves one character to the right
Ctrl + b cursor moves one character to the left
ALT + F cursor moves right one end of word
ALT + b cursor moves to the left one word first
Ctrl + XX cursor moves between the beginning of the command line and the cursor
Ctrl + u Delete from cursor to beginning of command
Ctrl + K Remove from cursor to end of command line
Alt + R Deletes the current entire row
Ctrl + W removes from the cursor to the top of the word from the left
Alt + D remove right from cursor to end of word
Ctrl + D Deletes a character at the cursor
Ctrl + H Deletes a character before the cursor
Ctrl + y Pastes the deleted characters after the cursor
ALT + C Change the first letter of the word from the cursor to the right
ALT + U starts at the cursor and changes the right word to uppercase
ALT + L CHANGES the right word to lowercase, starting at the cursor
Ctrl + t swap cursor at and before character position
ALT + t swap cursor and previous word position
ALT + N prompts you to repeat the character n times after you enter the specified character

注意:Alt组合快捷键经常和其它软件冲突

Linux Some instructions and shortcut operations, not regularly updated in ~ ~

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.