Linux Common basic commands

Source: Internet
Author: User

Linux File System architecture

/boot: Boot file directory, kernel file, boot loader is stored in this directory

/bin: Basic command for all users, can not be associated to a separate partition, system startup will be used by the program

/sbin: The basic command of the management class, cannot be associated to a separate partition, the program that the system starts to use

/lib: Basic shared library files that the program relies on at startup and kernel module files

/LIB64: storage location for shared library files dedicated to x86_64 systems

/etc: Configuration file directory

Home directory for normal users

/root: Admin Home Directory

/media: Portable mobile device mount point

/MNT: Temporary file system mount point

/dev: Device files and special file storage locations

/OPT: Third-party application installation location

/SRV: Data used by services running on the system

/tmp: Location of temporary file storage

/usr: The directory where the application resides

Linux Common basic commands

Shutdown or restart

Reboot restart (-F forced restart,-P power off)

Shutdown shutdown or restart

-R Restart

-h shutdown; Example: Shutdown-h now shuts down

Change Directory

CD Switch Directory

/switch to the root directory

.. Switch to Parent directory

PWD View current directory path

ls command

LS lists the contents of the current directory or the specified directory

-A Show hidden files

-L Display File details

-H display file size increases readability

Move copy and delete files and folders

Touch Create empty files and Refresh time

-A change atime and CTime

-M change Mtime and CTime

-T Specify timestamp

CP Copy File

-R recursively Copy folders and all files within it

-F Forced replication

-P preserves the properties of the source file or directory

MV Move and rename files

RM Delete

-R recursively Delete the folder and all contents inside

-F Force Delete

-I hints whether to delete

mkdir Creating a Folder

-P if the upper-level directory of the created directory is not created, the upper-level directory is created

RmDir Deleting a folder

-p Recursively Delete empty directories

Tree Display directory Trees

-l Specifies the number of directory layers to display

-D Show only directories

Link

LN creates a hard link to a file (can only create a hard link to a file)

Ln-s a soft connection to create a file (can be created on a directory)

Create and delete users

Useradd Creating a user

Userdel Deleting a user

SU can switch users

Text view

Cat View File Contents

More Paging View files

WC Statistics File Data

-L Statistics Row only

-W only counts the total number of words

-M only counts the total number of characters

grep text filtering

Vim command

Exit

: Q exit

: q! Forced exit

: Wq Save Exit

ZZ Save and exit

ZQ Do not save exit

Cursor movement

H move one character to the left

L Move one character to the right

K Move up one character

J Move down one character

W Next word First

E current or next word ending

b Current or Next word header

H Page Top

M-Page Middle

L Page Footer

Delete

DD Delete When moving forward

DJ Delete Current line and previous row

DK Delete the current row and the next row

10DD Delete a total of 10 rows from the beginning of the current line

D Delete the current cursor position to the end of the line

Edit

U undo

YY copy when moving forward

P Paste in current position

Find

/text find text, press N to find the next, press N to find the previous

? text find text, reverse lookup, press N to find the next, press N to find the previous

  

    

Linux Common 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.