Linux basic commands

Source: Internet
Author: User

1, how to shut down the command line? (the server generally does not shut down, the virtual machine does not have to shut down, click "Hibernate", keep its running state)

Enter shutdown or halt or Poweroff in the terminal

2. How to restart the command line?

Terminal input reboot

3. Go to directory CD directory path

CD/var/tmp

4. Create one or more directories mkdir dir

mkdir dir1     //Create a directory
mkdir dir2 dir3 //Create multiple directories mkdir dir{4,5,6} //Create multiple directories
MKDIR-P/D1/D2/D3 //Create a cascading directory

5, list the current file ls

LS    //lists the current directory's file ls-a/-l (optional parameter)
-a means to show hidden files as well
-L indicates show details, create date/size/permissions/attributes, etc.

6. Move files or folders or change the file name MV

MV  source folder/File  destination folder/file eg:    mv./dir1  ./dir2

MV source filename New file name
MV Name1 name2

7. copy file CP

CP source file target file CP Source directory target directory-R [recursive copy entire Directory]

8. Delete empty folder RmDir

Delete a file or folder rm

RmDir  Empty folder name     rmdir./dir2/dir1rm  file name rm-rf  folder name (-R indicates meaning of loop iteration,-f is mandatory meaning      RM tmp.txt    RM- RF./dir1

9. Show current Location pwd

10. Link Command ln (equivalent to a shortcut under Windows)

Ln-s source folder or source file   destination link name    ln-s/var/tmp  ./link.var

Linux basic commands

Related Article

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.