Linux Learning Private notes-basic commands for directories and files

Source: Internet
Author: User

ls: View files and directories

CD: Switch directories

PWD: Show current directory

mkdir: Creating a Directory

Rmkdir: Delete an empty directory

RM-RF: Delete the directory and delete all files in the directory

Echo: Display, print

MV source file path after move file path: Move File/directory

CP source file path copy to file path: Copy file

Cp-r source file path to file: Copy directory

Frequently viewed file contents:

Cat: Display file contents starting from the first line

TAC: Displays the contents of the file starting from the last line, in reverse.

NL: The output line number when displayed

MORE: A page-by-page display of file content

Less: page-by-page display of the contents of the file, can page up and down

OD: Read file contents in binary way

Touch: Create a file

File: View files Type

Common ways to find files:

Whereis: Search for the location of the command, cannot search for files.

Locate file name: Search in the background database by name, fast search speed. However, the new file must be executed updatadb, or locate cannot be searched.

Find [Search scope] [search criteria] File name: Search can use wildcards to search for multiple qualifying conditions under specified range.

grep [Search condition] [search string] file name: Searches for the specified string in the file.

Linux Learning Private notes-basic commands for directories and files

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.