Useful Linux commands

Source: Internet
Author: User
Useful Linux commands-general Linux technology-Linux technology and application information. For more information, see the following. The Linux commands listed below are the most important and useful for beginners and our daily applications.

I often use:
Whereis: Find the location of a command, source code, or manual (man) file, such as whereis java

[The following are commonly used for USB hard disk operations]
Lsusb: List USB devices.
Fdisk: A disk partitioning tool used to list disk devices, such as fdisk-l.
Mount/umount: attach/detach a disk.
Lsof: List open files (especially useful when you cannot umount), for example: lsof | grep mydisk
Kill: send signals to processes (commonly used to kill processes that occupy USB devices discovered by lsof), for example, kill-9 process no.

Arch: displays the architecture type of the processor.
Cat: view the file content, such as cat lorem.txt
Cd: change the working directory, such as cd/bin.
Cksum: Check the CRC checksum and the number of bytes in the file, such as cksum lorem.txt moo.txt.
Cp: copy a file, such as cp lorem.txt copy_of_lorem.txt.
Date: displays the current date and time.
Df: view disk space and available space
Du: view the space occupied by the Directory, such as du-h/bin.
Echo: echo foobar
Groups: view which user groups your account belongs
Hostname: displays the host name.
Id: view the user id, group id, and group of your account
Man: read the manual page, such as man bash.
Md5sum: view the MD5 value of the file, such as md5sum lorem.txt.
Mkdir: create a directory, such as mkdir foobar.
Mv: Move or rename a file, such as mv lorem.txt ipsum.txt
Ping: ping the host, for example, ping-c 2 127.0.0.1.
Ps: view running processes
Pwd: view the current working directory
Sha1sum: view the SHA1 value of the file, for example, sha1sum lorem.txt
Stat: view the File status, such as stat lorem.txt.
Rm: delete a file or directory, such as rm lorem.txt.
Rmdir: delete a directory, such as rmdir foobar
Touch: changes the file access and modification timestamp. If the file does not exist, create it, such as touch lorem.txt.
Tty: view the name of the current terminal
Uname: displays the system, host name, kernel version, date and time, and processor information, such as uname-.
Uptime: view how long the system has been running
W: check who is logged on and what are they doing
Wc: the number of rows in the Statistical File, such as wc-l lorem.txt.
Who: view who has logged on to the system
Whoami: view your user name (or account name)

Whereis is a fast, but not up-to-date query from the database recorded by the system.
Find is a real one-by-one query from the directory, which is slow

PS: Find the man manual using whatis or apropos
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.