Common Linux shortcut keys and basic commands, and linux shortcut keys

Source: Internet
Author: User

Common Linux shortcut keys and basic commands, and linux shortcut keys


*******
1. in Linux, only the drive letter/must be assigned to the partition where the system disk is located.
*******
2. swap partition, equivalent to the virtual memory in Windows, used to simulate the memory. When the memory is insufficient, swap partitions will be used. The size is generally set to 1.5-2 times of the physical memory.
**********

3. in Linux, all files starting with "." are hidden files.
*********
4. There are seven consoles in linux, the seventh is a graphical interface, and the first to sixth is the command line mode (Ctrl + f1 ~ F6), enter tty on the text interface to view the number of consoles;
*********
5. command syntax: Command-option... Parameter

Ls is used to list files in the current directory, which is similar to dir in Windows.
Ls-l (yes L)
Ls-1 (yes) displays one row of all files
Ls-a displays all files in the current directory, including hidden files.
Ls-s shows the file size and file size,
Ls-sh displays the file size and Unit
When there are multiple options: for example: ls-a-s-l => ls-asl

Ls -- help if the option is a word or multiple letters as an option, add --

Pwd displays the current directory

Command: Ctrl + l or clear

*********
Data is used to display the time and date

Data + % y indicates the last two digits of a year
Data + % m shows the current month

Cal displays the calendar of the entire month of the current month.

Cal 2016 displays the calendar for the entire year of 2016

Cal 12 (month) 2016 (year) view calendar of a month of a year

****
Bc enters the calculator function. By default, the fractional part after the decimal point is not retained. If you want to retain the fractional part after the decimal point: Execute
Scale = (number of decimal places to retain)

******
Tab: Automatically complete the input command
If a command or word can be uniquely identified by a few characters typed, pressing Tab will automatically complete
If the logo cannot be uniquely identified, press the Tab key twice to display all words starting with a few characters.

*****
History displays the 1000 historical Command records
To quickly reference the commands in history :! 22 (exclamation mark + number before the command)

* ** Ctrl + I the cursor will jump to the beginning of the line. Ctrl + e will jump to the end of the line.
Press Ctrl + left or right arrow to jump to a word
Ctrl + u from the current position, always delete to the beginning of the line
Ctrl + k from the current position, always delete to the end of the row

****
To Quickly call the parameters of the previous command:
Run: esc +.

****
Touch xx creates a text file
^ Xx ^ yy
These two commands are put together. ^ xx ^ yy re-executes the previous command and changes XX to yy.


* ***** Quick copy and paste Method
Select the desired content with the mouse, and then press the scroll axis in the middle of the mouse to automatically Paste


* ***** Terminate the command being executed: ctrl + c

***** Stop input:

*****
Ctrl + shift + t you can open multiple terminals. After opening multiple terminals, if you want to switch from the current terminal to the previous terminal: ctrl + shift + page up; if you want to switch from the current terminal to the next terminal after h: ctrl + shift + page down, if you want to disable the current terminal tag, you can enter the exit command or press the shortcut key ctrl + d

****
In Linux, uppercase and lowercase letters are strictly differentiated.


***********
When you encounter unknown commands or do not know how to use them
Whatis + (the command to be queried) only tells the function of the command, no detailed usage
If you cannot execute whatis, run makewhatis on the ROOT user.
For example:
Aston @ ubuntu :~ $ Whatis gcc
Gcc (1)-GNU project C and C ++ compiler
(1) After gcc indicates the number of chapters of the gcc command in manpage.



Command -- help
Example:
Aston @ ubuntu :~ $ Ls -- help
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default ).
Sort entries alphabetically if none of-cftuvSUX nor -- sort is specified.
Mandatory arguments to long options are mandatory for short options too.
-A, -- all do not ignore entries starting.
-A, -- almost-all do not list implied. and ..
-- Author with-l, print the author of each file

 

* ***** Man Manual
Man + command to be searched (the first chapter by default) is launched by q
Man + chapter + command to be searched

There is a colon in the lower left corner of the screen. When you need to search for a specific keyword, enter/, and then enter the keyword to be searched. Then press Enter, the key search times are highlighted. Then, press n to view the highlighted keywords from top to bottom. Press N to start searching from bottom to top.

If you want to search for a keyword starting with a specific letter:/^ abc find the keyword starting with abc

If you only remember a part of the command, you can get the command that contains a part of the command.

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.