Linux common commands are recorded

Source: Internet
Author: User

[[Email protected]~]#

Command prompt:

Where Root: Current login user

localhost: Host name

~: Current directory (~ indicates home directory)

# Super User prompt

$ normal User prompt

File processing commands: LS, mkdir, RM, CP, MV, LN

ls [options] [file or directory]

Listing Directory Contents

-A: Show all files, including hidden files

-L: Show detailed information

-D: View Directory properties

-H: humanized Display file information

-I: Display inode

Ls-l View Details (Linux does not differentiate files by extension, but relies on permissions):

    

mkdir-p [directory Name]

Create a Directory

-P: Recursively create a directory

RM-RF [file or directory]

Delete a file or directory

-R: Delete Directory

-F: Force delete

CP [Options] [source] [Target]

Copy

-r: Copy directory

-P: File attribute copying

-D: If the source file is a linked file, copy the link property

-A: equivalent to-PDR

MV [source] [Target]

Cut or rename a file or directory

ln-s [source] [Target]

Generate a linked file

-S: Create soft links (similar to Windows shortcuts)

File Search command: Locate, find, grep

Locate file name

Search by file name in the background database, search faster.

/etc/updatedb.conf: Search configuration file

Background database for/var/lib/mlocate:locate command search

UpdateDB: Updating the database

Find [Search scope] [search criteria]

Search for eligible filenames in the system

-mtime: Search by modified time

-name: Search by file name

-size: Search by File size

grep [option] string file name

Match a qualifying string in a file

-I: Ignore case

-V: excludes the specified string

Compression commands (common compression format:. tar.gz,. tar.bz2): Tar

TAR-CVF package file name source file

-C: Packaging

-V: Display procedure

-F: Specifies the file name after packaging

EG:TAR-CVF File.tar File

TAR-XVF Package file name

-X: Unpacking

TAR-ZCVF compressed package name. tar.gz Source File

-Z: Compressed to. tar.gz format

TAR-ZXVF compressed package name. tar.gz

-Z: Unzip. tar.gz format

TAR-JCVF compressed package name. tar.bz2 Source File

-J: Compressed to. tar.gz format

Tar JXVF compressed package name. tar.bz2

-j: Unzip. tar.gz format

Shutdown and restart command: shutdown

shutdown [option] Time

-C: Cancel the previous shutdown command

-H: Shutdown

-R: Restart

Linux common commands are recorded

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.