Linux basic commands

Source: Internet
Author: User

Cd:

CD dir: Switch the working directory to the directory represented by DIR

CD: Switch The working directory to the home directory of the logged-on user

CD-: Switch The working directory to the last working directory

CD ~: Switch working directory to home directory

CD ~username: Switch The working directory to the home directory of the specified user "USERNAME" only for use with the root user

Pwd:

PWD: Displays the name of the current working directory

LS: In the Linux file system, all with "." Files that start are hidden files

-A: Show all files including hidden files

-A: Displays except. and. All files outside of the file include hidden files

-D: Content that does not display the directory displays only the directory name of the directory

-L: Displays detailed properties of a file in a long format

-H: Easy to read file size format, usually using 1024 binary for unit conversion

-Z: Display the file's SELinux security context

mkdir: Creating a Directory

RmDir: Only empty directories can be deleted and files cannot be deleted

RM: Remove files or directories

-I: Interactive deletion with users

-F: Force delete without any hint

-r: Can delete contents of directory recursively

Touch: You can modify the timestamp of the directory, but try not to modify it for future time

Stat: View the status of a file

-C: Display specific properties of a file in a specific format

Nano

^: de-Char, which represents the CTRL key

Cat

-B: Line numbering for non-empty line content

-N: Number by row for all rows

-S: Merge multiple lines of blank behavior row

-E: Displays the line terminator at the end of each line in the document, expressed in $

Reverse output of Tac:cat

Head

-N: Displays the first n rows of the file, or it can be abbreviated-#

-C:[B|K|M|G] Displays the first # Characters of a file

b=512 bytes k=1024 bytes

Tail: Always monitor the changes at the end of the file using ^ exit

More, Less: pagination Displays the contents of a file

Hardware clock: hwclock, clock

-S: Set the system clock as a reference to the hardware clock

-W: Set the hardware clock as a reference to the system clock

--set: Set the hardware clock to the time indicated by

System clock: Date

Date-s "2017/10/10 10:10:10"

Date-s "2017-10-10 10:10:10"

Cal: Show Calendar

Shutdown:

Halt: Power off source is shutdown

Shutdown: Reminder shutdown

-H: Shutdown system

-R: Rebooting the System

-C: Cancel the shutdown job that is about to be performed at one time

Reboot: Re-boot

Log off, sign out

Exit: Exit the current shell

Logout

^+d

Cp:

CP [OPTION] ... SOURCE DEST (Single source replication)

CP [OPTION] ... SOURCE ... DIRECTORY (Multi-source replication)

Note: At least two parameters typically the last parameter is the target of this replication if the target of a cell copy can be a non-directory file but a multi-source replication must be a directory

-D: Copied source If it is a symbolic link file, the symbolic link file is copied directly to the target location, not the file it is linked to

-P: Ability to preserve file permissions when copying files, all and timestamps

-R: Ability to recursively replicate directories and files in a directory

-A: equivalent to the combination of the-DPR option

MV: Mobile

MV [OPTION] ... SOURCE DEST (Single source replication)

MV [OPTION] ... SOURCE ... DIRECTORY (Multi-source replication)

-F: Force overwriting of files with duplicate names in the target location









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.