Common basic commands for "Linux" Linux

Source: Internet
Author: User

There are many common commands in Linux that must be mastered, and here I will learn some common basic commands that I learned from Linux to share with you and hope to help you.


This is the bird in the book I have done a bit, I hope not to deal with copyright issues.


1. Instructions for displaying dates: date




2. Instructions for displaying the calendar: Cal



3. Simple and easy to use calculator: BC



Why would 10/100 become 0? This is because BC presets only output integers, and if you want to output a decimal point, you have to execute Scale=number, which is the number of decimal places, for example:



4. 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


5, man

Exit with Q,

Man-f Mans



6. 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!



7, 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



8. 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:



9. Change the file's owning group: CHGRP



10. Change the file owner: Chown


He can also change the name of the group directly dwellings



11, 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:



12. View version information, etc.



13. Change Directory: CD



14. Show current directory: PWD



15. 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.

16. Delete "Empty" directory: RmDir



17. Display of files and directories: LS



18. Copying Files or directories: CP



19. Removal of files or directories: RM



20. Moving files and directories, or renaming: 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 archive: Cat



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



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



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



26, similar to more, but better than more, he can 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 create a new profile: Touch



31. File Preset Permission: Umask



32. Profile File Hidden properties: Chattr



33. Show file Hidden properties: Lsattr



34. Observation file type: Files



35, look for "execution gear": which



36. Find specific files: Whereis



37. Find specific files: Locate



38. Find a specific file: Find



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



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



41. Compressing files and reading compressed files: Tar



Well, exhausted, finally finished, hope to be able to help everyone.


Common basic commands for "Linux" Linux

Related Article

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.