File management of Linux basic commands

Source: Internet
Author: User

Linux: All Files


Create a file

Mkdir/hello establishing/hello directory

Remove directory rmdir-p remove only empty directories

Install can also create a directory

Touch file name Create a file

Nano Build file

VIM + filename creation file


deleting files

Rm-r Deleting a directory
RM-RF forcibly deleting a directory
\RM Delete Does not prompt


Copying files
CP Source File Destination
CP file1 File2 file3 Two files cannot be copied into one file
Copy a file to a file
Copy multiple files to a directory
-A: Archive replication, often used for backup
Cp/etc/{passwd,inittab,rc.d/rc.sysinit}/tmp/copy three files


MV source file or directory ... Target Location


View File Contents

cat + file name View the contents of the file (default view is the first 10 lines)
Tail + file name      several lines after viewing the contents of a file
tail-f + file name   View the contents of a file in real time
Head + file nameto view the contents of a file first few lines

Split screen Display
more+ file name Turn Back

less+ file name is flipped forward

file + file name Press the Q forward to exit


File management of Linux basic 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.