Summary of common Linux commands

Source: Internet
Author: User

Summarize the Linux commands used.

(Linux Command Summary: http://linux.chinaitlab.com/special/linuxcom)

1) View and sort the size of a folder.( Du, SortCommand combination)

For example, the current folder is
. Cache

$ Du -- Max-depth = 3-H | sort-hr

680 m.

657 m./tracker

17 m./abrt/spool/ccpp-2012-09-08-21: 12: 57-1942

17 m./abrt/spool

17 m./abrt

5.2 m./Kingsoft

3.6 m./Kingsoft/WPP/HTTP

3.6 m./Kingsoft/WPP

1.7 m./Kingsoft/WPS/HTTP

1.7 m./Kingsoft/WPS

852 K./ibus

768 K./Wallpaper

684 K./ibus/Bus

92 K./ibus/libpinyin

72 K./ibus/pinyin

Note: Du-estimate file space usage (see Man Du for details)

Sort-Sort lines of text files (for details, see man sort)


2) display a column. ( Cut command)

$ Date
Wed Jan 2 10:22:52 CST 2013

$ Date | cut-D ''-F5

10:23:33

3) Search for a file in the directory. (Tree, grep)

$ Tree | grep-C 5 "busybox"

4) use grep in the file to search for multiple keywords (grep)

$ Grep-e "Open | create" fcntl. h

Note: The knowledge of using regular expressions, where '|' indicates or.

5) solve Chinese garbled characters

$ Convmv-f gbk-T UTF-8-r -- notest *

(From GBK to UTF-8, change the subdirectory and correct the file name .)

6) create a GIF Image

$ Convert-delay 0 photo-00 {16 .. 23} *-loop 0 test.gif

(Note: {16 .. 23} represents 16 17 18
... 23 is easy to use .)

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.