"Linux" Linux common Basic Command Summary (recommended) _linux

Source: Internet
Author: User

Many of the most common commands in Linux must be mastered, and here I share some of the basic commands I learned when I started Linux, hoping to help you.

This is I will be the book on the bird in the collation, I hope not to involve copyright issues.

1, display the date of instruction: date

2, display the calendar instructions: Cal


3, simple and easy to use calculator: BC


How does 10/100 turn out to be 0? This is because the BC preset outputs only integers, and if you want to output the decimal point number, you must perform Scale=number, which is the number of decimal places, for example:

4, important several hot keys [tab],[ctrl]-c, [ctrl]-d

[TAB] Key---The function of "command complement" does not "file complete"

[Ctrl]-c Key---Let the current program "Stop"

[The CTRL]-D key---typically represents: "Keyboard input ends (end of File, EOF ring Ofinput)", and he can also be used to replace exit

5, Mans

Exit with Q,

Man-f Mans

6. Data Synchronization Write Disk: Sync

Enter sync, the data that is not yet updated in memory, is written to the hard drive, so this 挃 order is important before the system shuts down and reboots 乀. It's best to do it more times!
7, the customary shutdown instructions: shutdown
In addition, it is important to note that the time parameters must be added to the instructions, otherwise shutdown will automatically jump to Run-level 1 (that is, single maintenance login), so nerve-racking! Here are some examples of time parameters:
Reboot, Shutdown: reboot, Halt,poweroff

8. Switch execution level: init

There are seven levels of execution for Linux:

--run Level 0: Shutdown

--run Level 3: Plain text mode

--run Level 5: Contains graphics interface mode

--run Level 6: Reboot

Use the init command to toggle each mode:

If you want to shut down, you can also use the following instructions to turn off the computer except for the shutdown-h now and Poweroff:

9, change the file belongs to the group: CHGRP

10. Change document owner: Chown

He can also modify the name of the group directly mandatory

11, change the file permissions: chmod

There are two ways to set permissions, and you can use numbers or symbols to change permissions.

--Number Type change file permissions:

--Symbol Type change file permissions:

12, view version information, etc.

13. Transform Directory: CD

14. Display the current directory: PWD

15, the establishment of a new directory: mkdir


It is not recommended to use the-p option because you are worried that if you typo, the directory name will be messed up.

16, delete the "empty" directory: RmDir

17, File and directory display: LS


18, copy the file or directory: CP


19. Remove file or directory: RM


20, mobile files and directories, or renamed: MV

21, get the path of the file name and directory name: Basename,dirname


22, starting from the first line to display the contents of the file: Cat

23, starting from the last line: TAC (you can see that the TAC is cat-written backwards)

24, display time, by the output line number: NL


25, one page of the display file content: more

26, and more similar, but better than more, he can turn the page forward: less

27, only a few lines: Head

28, only look at the end of a few lines: tail

29. Read the contents of the file in binary position: OD


30, modify the file time or new file: Touch


31, File preset permissions: umask

32. Profile file Hidden properties: chattr

33. Display file hidden attribute: lsattr

34, observe the file type:

35, looking for "execution block": which

36, looking for specific files: Whereis

37, looking for specific files: locate

38, looking for specific files: find


39, compressed files and read compressed files: Gzip,zcat


40, compressed files and read compressed files: Bzip2,bzcat


41, compressed files and read compressed files: Tar



Well, exhausted, finally finished, hope to be able to help everyone. We also hope that we can support the cloud-dwelling community.

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.