Unfamiliar and commonly used linux commands

Source: Internet
Author: User
Common linux commands-general Linux technology-Linux technology and application information. For more information, see the following section. 1. compression and decompression:

Decompress xxx.tar.gz

Tar-zxvf xxx.tar.gz

Decompress xxx.tar.bz2

Tar-jxvf xxx.tar.bz2

Compress aaa bbbdirectory as xxx.tar.gz

Tar-zcvf xxx.tar.gz aaa bbb

Compress aaa bbbdirectory as xxx.tar.bz2

Tar-jcvf xxx.tar.bz2 aaa bbb

2. Search commands

Quick search for a file location

Whereis filename

Find directory-name file name

View File Types

File filename

Display the last six lines of xxx File

Tail-n 6 xxx

Search for files containing xxx strings

Grep-l-r xxx.

View Current memory usage

Free-l

3. View device and system information

View the kernel

Uname-

View Ubuntu version

Cat/etc/issue

View the modules loaded by the kernel

Lsmod

View PCI devices

Lspci

View USB devices

Lsusb

View Nic status

Sudo ethtool eth0

View CPU Information

Cat/proc/cpuinfo

Display current hardware information

Lshw

Hard Disk

View Hard Disk Partitions

Sudo fdisk-l

View remaining disk space

Df-hdf-H

View space occupied by Directories

Du-hs directory name

The USB flash drive cannot be detached.

Syncfuser-km/media/usbdisk

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.