Linux Small White Primer II

Source: Internet
Author: User

Excerpt from Zhu Youpeng Teacher's public lesson video

2, Linux basic knowledge and skills
2.1. Linux kernel, release version
Linux itself refers to an operating system kernel that cannot be used directly by the kernel. What we need, the operating system that can be used is a combination of the kernel and a number of useful applications, called the Linux distribution.
Ubuntu, Redhat is a different version of Linux.
2.2. GUI (graphical user interface) and CmdLine (command line)
Gui:grahics user interface, GUI.
Cmdline:command lines, command line.
Human-Computer Interaction: People interact with machines (computers), often with command line and GUI.
Windows has both a GUI and a command line. Linux also has both a GUI and a command line.
However, in Linux we often use the command line, in Windows common GUI
2.3. Common Linux Commands
(1)ls (list, listing)(common)
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) role: 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 folders (Common)

(5) MV (move, move)(Common)
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, copy)(Common)
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)(common)
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

(11) ln (link, connection file) (Common)
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:

-rwxr-xr-x

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

Linux Small White Primer II

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.