Several common Linux commands

Source: Internet
Author: User

Ls

Function: View the files in the directory

Format: direct ls view current directory, or ls parameter / directory name

Parameters:- l View details

-A show hidden files

. represents the current directory

.. Parent Directory

-G uses different colors to mark different types of files (commonly used under Mac OS, ubuntu default ls = ls-g)

Pwd

Role: View Path

Format: Direct pwd View current path, or pwd directory name

Cd

Tips:

Direct CD or CD ~ back to /Home

CD- back to the last switch directory

CD/ back to the root directory

Date

View system time

Hwclock

View BIOS time

Shutdown command:

Shutdown

Format:shutdown parameter

-R Restart (-R+ min) (-Rnow)

-H Shutdown (-h+ min) (-H now)

-C cancel shutdown command

Init

Role: Switching system level

Format: init 0-6

Init 0 is used to immediately switch the system runlevel to 0, i.e. shutdown

Init 6 is used to immediately switch the system RunLevel to 6, that is, restart

Reboot

Restart

RunLevel

View current system Run level

Switch to the graphical interface in the character interface:

1, StartX

Start the graphical interface only, without switching the system RunLevel

2. Init 5

Switching system operating levels

! $   last parameter of previous command

echo Prints the value of a variable or a string

Create an empty file

Touch file name . extension (can be extended without extension)

Terminal Clear Screen

Ctrl + L

Create an empty folder

mkdir file name (makedirectory)

Mkdir-p/ROOT/1/2/3/4/5 plus parameter - p to create a path directly

Copying files

Cp

-r Copy entire folder (the source folder is created under the target directory)

eg cp-r/etc//root/copy the entire etc to root

-R. /* Copy all files under the entire folder (no source folders are created)

eg cp-r/etc/*/root/ Copy all the files under etc to root

Delete

RM-RF file or directory name

-R Recursive Delete (delete all files in directory and directory)

-F forcibly removed

If you do not add the-r parameter, you are prompted not to delete the directory

Without the- F parameter, you will be asked if you want to delete

Rename / move

MV Source Target

View hard disk usage

Df-h

Viewing the current Mount situation

Mount

Several common Linux 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.