Common basic commands for Linux

Source: Internet
Author: User

Enter root modesu Rootreturn normal mode su user nameSudo-i This method to enter the password of the current administrator user can be entered into the root usersudo passwd rootsudo passwd1. Important several hotkeys [Tab],[ctrl]-c, [ctrl]-d 

[Tab] Key---with "command completion" not "file full" function

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

[ctrl]-d Key---usually means: "Keyboard input ends (end of File, EOF end ofinput)" meaning; In addition, he can be used to replace exit

2, man

Exit with Q,

Man-f Mans

3. Data synchronously written to disk: Sync 

Enter sync, and the data that has not been updated in memory will be written to the hard drive, so this led makes it important before the system shuts down and restarts cookbook. It's best to do it several times!

4, the customary shutdown command: Shutdown 

In addition, it should be noted that the time parameter must be added to the directive, otherwise shutdown will automatically jump to Run-level 1 (that is, the single-person maintenance of the login), so it is a headache! Here are a few examples of time parameters:

Restart, shutdown: reboot, Halt,poweroff

5. Switch execution level: init 

There are seven levels of execution in Linux:

--run Level 0: Shutdown

--run Level 3: Plain text mode

--run Level 5: Graphics interface mode included

--run Level 6: Restart

Use the init command to switch between the modes:

If you want to shut down, you can also use the following instructions to shut down your computer, in addition to the shutdown-h now and Poweroff above:

6. Change the file's owning group: CHGRP 

7. Change the file owner: Chown 

He can also change the name of the group directly dwellings

8, change the permissions of the file: chmod 

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

--Digital Type change file permissions:

--Symbol Type change file permissions:

9. View version information, etc. 

10. Change Directory: CD 

11. Show current directory: PWD 

12. Create 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 become messy.

13. Delete "Empty" directory: RmDir 

14. Display of files and directories: LS 

15. Copying Files or directories: CP 

16. Removal of files or directories: RM 

17. Moving files and directories, or renaming: MV 

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

19, starting from the first line to display the contents of the archive: Cat 

20. Starting from the last line: TAC (can see that the TAC is backwards written by cat) 

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

22, one page of the contents of the file: more 

23, similar to more, but better than more, he can page forward: less 

24, only a few lines: Head 

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

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

27. Modify the file time or create a new profile: Touch 

28. File Preset Permission: Umask 

29. Profile File Hidden properties: Chattr 

30. Show file Hidden properties: Lsattr 

31. Observation file type: Files 

32, look for "execution gear": which 

33. Find specific files: Whereis 

34. Find specific files: Locate 

35. Find a specific file: Find 

36. Compress files and read compressed files: Gzip,zcat 

37. Compress files and read compressed files: Bzip2,bzcat 

38. Compressing files and reading compressed files: Tar 


Common basic commands for Linux

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.