Linux Common Command collation

Source: Internet
Author: User

Since entering the pit of node. js, it is unavoidable to deploy some applications on the Linux server. So I'm going to start learning the basics of Linux and sort it out for you when you need it.

1. Query the contents of the directory: LS

ls Options [File or directory]

-a displays all files, including hidden files

-L Show Details (I usually use the shorthand is LL)

-D Display Directory properties

-H humanized Display file size

-I display Inode

2. Create directory: mkdir

mkdir -P [directory name]
-P Recursive creation

Example:

Mkdir-p Dir1/file1

3. Where to switch: CD (change directory)

Simplified operation:

CD  ~    Enter the current user's home directory
CD  -    go to last directory
CD  ..    Go to the top level directory

4. Delete files or directories: RM (remove)

RM  -RF  [file or directory]
-R Delete Directory
-F Mandatory

5. Copy command: CP (copy)

CP  [Options]  [Original file directory]  [Target directory]

-R Copy Directory

-P Joint File attribute copy

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

-A equals-pdr

6. Cut or rename command: MV (move)

MV  [Original file or directory]  [Target directory]

7. Link command: ln (link)

LN  -s  [original file]  [target file]-s  create soft link  (similar to shortcut) hard link has the same I node and storage block block can be considered as a file (two portals of a file) 

8. File Search: Locate

Locate   file name search in background database by file name search faster /var/lib/mlocatelocate command searches the background database updatedb when the newly created file is not updated into the background database Unable to search for this file with locate the general system automatically updates the background database once a day to manually update the command and then to search for the newly created file

Linux Common Command collation

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.