Basic shell commands using notes

Source: Internet
Author: User
Tags create directory

Linux Common commands:

(LS: List directory contents)

-a/-all list all files, including hidden files

-L displays details using long format, including rwx

(mkdir: Create directory)

-p/-parents to create a directory where the upper-level directory is not yet established, a top-level directory is created

Mkdir-p Parent/child

(rmdir delete directory)

-p/-parents if the upper directory is empty after deletion, delete

Rmdir-p Parent/child

(PWD displays the current directory)

(CD directory switch)

(CP copy directory or file)

-r/-recursive recursively processing the directory with its next file and sub-directory

-f/force forcibly copy files or directories, whether or not they exist

-i/-interactive ask users before overwriting existing files

-l/-link to create a hard link to a source file rather than copying a file

-p/-preserve Preserve source files or directory properties

-p/-no-dereference do not track soft links

(MV moves or renames an existing file or directory)

-b/-backup If you need to overwrite the file, back up before overwriting

-f/-force if the destination file or directory is duplicated with an existing file or directory, directly overwrite

Ask the user before-i/-interactive overwrite

(rm delete file or directory)

-d/-directory Remove the hard-link data from the deleted file to 0, delete the directory

-f/-force forcing a file or directory to be deleted

-i/-interactive ask the user before deleting

-r/-r/-recursive recursive processing

(Du shows the size of a file or directory)

(Cat display file contents)

-n/-number numbering of all output lines starting from 1

-b/-number-nonblank is similar to-n but not numbered on blank lines

-s/-squeeze-blank when two or more blank lines are encountered, merge into one line of blank lines

(more split screen display)

-F Number of rows, in actual number of hungry rows instead of lines after wrapping

-P does not scroll to display each page but first clears the screen and then displays

(head starts at the beginning of the file)

(tail starts at the end of the file)

(Touch for new files)

(PS shows the current system's progress)

Search command:

(which find where the command program is located)

-n < filename length > specify file name length

-p < filename length > same as-N, but file name length contains path

-W Specifies the width of the output field

-V Display version information

(Whereis)//More than which look for a wide range, but not the overall search

-B finds only binary files

-B < directory > find binaries only in set directory

-F path name before the actual file

-M only looks up the description file

-m< Catalogue >

-S only finds the original code file

-s< Catalogue >

(Find path expression)

(grep searches for specified directories or files to display matching content based on specified criteria)

-I ignores case

-R Recursive Search directory

-L if match multiple times, show only once

Basic shell commands using notes

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.