Linux Operation Instructions Part II

Source: Internet
Author: User
Tags clear screen create directory

Graphical interface and command interface switching


># init 3//Switch to command interface
># init 5//Switch to graphical interface

View the executable file location for the instruction


> which directive

Direct output file contents to Terminal


> Cat Files

Clear Screen


> Clear

Directory Operations


1. Create directory make Directory
> mkdir directory Name//create a single directory
> mkdir-p newdir1/newdir2/newdir3//Recursive creation of multilevel catalogs
> mkdir Dir1/dir2/newdir
> Mkdir-p dir1/newdir2/newdir3
The new directory has a level greater than or equal to 2, you need the-p parameter,
equals 1, no need.
> Mkdir/home/jinnan/shandong//"absolute path mode" for the relative root directory to create the Shandong directory

2. Moving the directory move
> MV Dir1 dir2//dir1 moved to the DIR2 directory
> MV Dir1/dir2 dir3//dir2 moved to the DIR3 directory
> MV Dir1/dir2 dir3/dir4//dir2 moved to the DIR4 directory
> Mv/home/jinnan/beijing/home/jinnan/shandong//absolute path mode: Beijing move to Shandong Directory
(The destination directory that you moved to is "existing")


3. Directory Change name operation
The second parameter of the MV instruction is the new name or the name change operation.
The name that exists is the move operation
MV is the "Move and change name" merge directive
> MV Dir1 newdir//dir1 move to the current directory and change the name to Newdir
> MV Dir1/dir2 dir3//dir2 move to dir3 directory and change name to original
> MV Dir1/dir2 dir3/newdir//dir2 move to the DIR3 directory and change the name to Newdir

4. Copy (and change name) operation copy

-R Recursive Recursive
> Cp-r dir1 dir2//dir1 copied to Dir2, and renamed as original name
> cp-r dir1/dir2 dir3/newdir//dir2 Copy to Dir3, and change name to Newdir
> cp-r dir1/dir2 newdir//dir2 Copy to current directory and change name to Newdir

> CP Dir1/filea dir2//filea copied to Dir2 and renamed as original name
> CP dir1/filea dir2/dir3/newfile//filea Copy to Dir3, and change name to NewFile

5. Delete operation remove
-F force forced ROM tar
> RM File//delete file files
> rm-r dir//delete directory
> RM-RF filename//recursive forced Delete file (directory)

> RM-RF///recursive forced delete "/slash" root directory

Linux Operation Instructions Part II

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.