Summary of Common Linux commands

Source: Internet
Author: User

Linux Common commands:

(1) LS (list, listing)

Function: Use the list to display all the files in the current folder

Ls-a Show all files, including hidden files

Ls-l Display in detail

Ls-a-L

Ls-l-A

Ls-la

Ls-al Four ways are possible.

(2) CD (change directory, changing directories)

Function: Used to switch directories

Relative paths and absolute paths are involved

Cd.. .. Represents a previous level directory

. Represents the current directory

(3) PWD (print work directory)

Function: Prints out the current absolute path


(4) mkdir (make directory, create folder)

Role: Create an empty folder

Mkdir-p Creating a folder for cascading

(5) MV (move, mobile)

Action: Move files between directories, rename files

MV Source files Pathname Destination Files pathname


(6) Touch

Action: Create an empty file

Touch pathname

(7) CP (copy, duplicate)

Role: Copying Files or folders

CP source File Pathname target file pathname

Cp-r used to copy folders

Cp-f forced replication

In practice, it is generally cp-f to copy files,

CP-RF Copying folders


(8) RM (remove, remove, delete)

Role: Used to delete files, folders

RM File Pathname

Rm-r Folder Pathname

(9) Cat

Function: Displays the contents of the file directly under the command line

can also be used to input files, temporarily regardless of

(rmdir) (remove directory, delete folder)

Role: Delete Empty folders

The difference between rmdir and rm-r: rmdir can only delete empty folders, and rm-r delete empty folders and non-empty folders


(one) ln (link, connection file)

Basics: Shortcuts in Windows, actually shortcuts and the files it points to are separate two files, two of which occupy hard disk space, except when a user accesses a shortcut, the effect is equivalent to accessing the file to which it is pointing.


There are two types of connection files in Linux:

A soft connection (symbolic Connection), equivalent to a shortcut in Windows

A kind of called hard connection

Create soft Connection file: Ln-s source file name symbol connection file name

Example: Ln-s src.c,linker.c,linker.c is

A symbolic connection file for SRC.C


Hard Connect: ln source file name connection file name

The hard connection is actually the same thing as the source file on the hard disk, the effect is similar to a file on the hard disk, on the file system, we seem to have a lot of files. Each time a file is deleted, the file is not actually deleted as long as he has other hard connections. Only when all the connection files are deleted, will this file be actually deleted from the hard drive.




Basic knowledge:

1. Ls-l Display Details:

-rw-r--r--

Drwxr-xr-x

A total of 10 characters, the first character representing the file type, and the next 9 characters representing the file permissions.

File type: the

-Represents a normal file. Ordinary files refer to text files and binary

files, such as A.C 1.txt a.out are common Files

D is the folder, and D is the directory abbreviation

L represents a symbolic connection file, which will then print out the file it points to

s represents the socket file

P indicates pipeline file pipe


This article is from the "Linux" blog, so be sure to keep this source http://13071273676.blog.51cto.com/7488391/1795167

Summary of 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.