Linux Common Commands

Source: Internet
Author: User

  1. Dir View your current location

  2. CD/Switch Directory

  3. Cd.. Switch to the previous level directory

  4. LS lists the file names under the directory

  5. Ls-l listing the files in the directory for more information

  6. LS-LH list the user-friendly information of the files in the directory (can be displayed size)

  7. Ls-a list hidden files in directory

  8. Vim. Test creates a hidden file (. Test)

  9. Vim filename To create a file, and then press I key into the insert mode, enter the content after pressing ESC to exit the Insert mode, then press shift+: Key, then enter Wq, press ENTER, save and exit

  10. VI file name function similar to VIM

  11. Cat file name read out the full contents of the file

  12. More FileName page Read the contents of the file, press ENTER can be one line down, press the space can page by page down

  13. mkdir Directory name creation directory

  14. Mkdir-p Directory Name/directory name/directory name/recursive create multi-level directory

  15. MV FileName Directory Name/move file to the specified directory

  16. Tree directory name Trees view the files and directories under the specified directory, or the tree structure of the current directory if the directory name is not written

  17. CP file name Directory name copy files

  18. MV FileName Directory name to move files, delete files to the Recycle Bin can be MV to the/tmp/directory

  19. RM file name Delete files, completely deleted, unrecoverable, more dangerous, not recommended for excessive use

  20. > File name empty contents, free space

  21. Touch file name

  22. Df-h view Current disk size usage, space usage and remaining in the current directory

  23. Ll-h viewing file list information under directory

  24. PS-EF|GREP DD View process run for DD operation

  25. Kill process Number End process

  26. Kill-9 process number forced end process

  27. RmDir Create an empty file

  28. Tar zcvf xxx.tar.gz./* Package All files in the current directory or specify which files to package

  29. Du-h to view the size of the current folder, or to view the specified file size

  30. Free-m view the current memory and usage of the server in M

  31. IP A view the current IP address of the server

  32. Chown user name. User group name Directory name/modify the user group to which a directory belongs

  33. RWX r-x R-x

    • R Read Readable 4

    • W Write writable 2

    • x Excute Execution 1

    • -No Permissions 0

    • Each 3 is a group, this permission is: 4+2+1 4+1 4+1, namely: 7 5 5

    1. Touch file name to create a file

    • DF View disk storage and usage information

      • The first column of/DEV/SDA1 is a disk partition, which corresponds to the C drive of Windows

      • The last column of mounted on, equivalent to the drive letter of Windows

    1. Find

      1. Find/-name* file name * Fuzzy Lookup by file name

      2. Find/-size +10m by file size

      3. Find/-size +100m |xargs ls-sh by file size to display the size units of the Find results file

        1. Where |args is a pipe character, the function is to give the results of the previous command to the following command execution, the previous result as the input of the following command

    2. Top view system processes, CPU usage

    • Cpu (s): 1.0%us 18.4%sy, 0.0%ni, 0.0%id, 63.5%wa, 0.0%hi, 7.2%si

      • US stands for user and represents CPU usage for ordinary users

      • SY stands for System, CPU occupied by the operating system itself

      • WA stands for Iowait,63.5%wa, representing the IO operation of the hard disk or the network port, waiting for IO to be longer than

      • IDLE:CPU Idle Rate

    • mem:1004772k Total, 933184k used, 71588k free, 215624k buffers

      • Mem, representing memory

      • Total: Memory

      • Used: Memory usage

      • Free: Memory Idle

      • buffers, buffer

    • swap:786428k Total, 13784k used, 772644k free,58350k Cached

      • Cached, representing cache, pre-occupied memory, does not actually use so much, but takes memory directly from these memory

      • The real memory idle rate is MEM's free+buffers+cached

    • PID, is the process number

    • Q or CTRL + C to exit the top command

Linux Common Commands

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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: and provide relevant evidence. A staff member will contact you within 5 working days.