Linux notes (i)-Directory processing commands

Source: Internet
Author: User

(1) Listing files: LS
-a displays all files and directories, including hidden files
-L Display detailed information (long format display)
-D Displays the directory itself
-H humanized Display
-I view I node
(2) Create directory: mkdir
-P Recursive creation
multiple, mkdir AA bb cc can be created at the same time
(3) Switch directory: CD
. Go to current directory
.. Go to Parent Directory
(4) Display the current directory absolute path: pwd
(5) Delete empty directory: RmDir
(6) Copy: CP
-R Copy Directory
-P Preserve Original file attributes
Multiple CP A.txt can be duplicated simultaneously b.txt/tmp/cc
(7) Cut renaming: MV
Multiple MV A.txt can be cut simultaneously b.txt/tmp/cc
(8) Delete: RM
-R Delete Directory
-F Direct Delete, no hint
Example: Rm-rf install.log
(9) Create an empty file: Touch
(10) Browse file contents: Cat
-N Display Line number
Reverse, TAC
Example: Cat Install.log
(11) Paging Display file contents: more
Space page
Carriage return line break
Q exit
Example: More Install.log
(12) Paging displays the contents of the file: less to page up
Space page
Carriage return line break
Q exit
PageUp PAGE Up
Up ARROW upside down line
/keyword search keywords
N Next key word
Example: Less Install.log
(13) Display the first few lines of the file: Head
-n Specifies the number of rows
The first 10 rows are displayed by default
Example: Head-n 7 Install.log
(14) A few lines after displaying the file: Tail
-n Specifies the number of rows
-F Dynamic display of file end content
Example: TAIL-FN 7 Install.log
(15) Generate Link file: ln
-S Soft Connect
Generate Hard Links by default
Difference:
Soft Connect is just a shortcut, delete source file link is invalid
Hard links are common to one I node, delete does not affect others, cannot span partitions, cannot point to directories
Example: Ln-s/root/install.log a.txt

Linux notes (i)-Directory processing commands

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.