Admin (ii)--linux command line Basics

Source: Internet
Author: User
Tags parent directory file permissions

Tagged with: Mount wildcard alias

One, the Linux command
The execution of the Linux command depends on the interpreter (for example:/bin/bash)
Classification of 1.LINUX Commands:
--Internal command: part of the Interpreter
--External command: A program other than the interpreter

2. Several shortcut keys
--ctrl+l: Empty the entire screen (or enter clear at the command line)
--ctrl + u: emptying to the beginning of the line
--ctrl + w: delete a word (delimited by a space)
--ctrl + C: End a running instruction
--esc +. : Pastes the arguments of the previous command

Two, Mount Mount operation
1. Mount and Mount points
--mount point: The mount point is the access point, and access to the device is required through the access point. The icon for a Windows Live symbol is an access point, and the access point for Linux is a directory.
-Mount: Mount the CD/u disk/partition/network storage device to a Linux directory. Various command tools operate these devices by accessing the Linux directory.
2. Command format
#mount Device path mount point directory
Example: #mount/dev/cdrom/mnt//mounting device
#ls/mnt//access to device content

3. Unmount a mounted disc or partition
Format: #umount mount point Directory
Example: #umount/mnt

Third, view the directory
1.ls command
Format: LS [options] [directory or file name]
Common Command Options
-L: Display in long format
-A: Include hidden files whose names begin with.
-D: Displays the properties of the directory itself (not the content)
-H: Provides easy-to-read capacity units (K, M, etc.)
-r: Indicates recursive display

2. Wildcard characters
For an indeterminate document name car, represented by a special character
--? : Represents a single word I character
-- : denotes multiple arbitrary characters
--[A-Z]: one of multiple characters or continuous range, omitted if none
--{A,MIN,XY}: Multiple sets of different strings, full match
For example: ls-d/M
matches a directory starting with M
ls-d/M?? Matches a directory that starts with M and has a name of three characters

Iv. New Document
1.mkdir Creating a Directory
Format: mkdir [-P] [/path/] Directory name
For example: #mkdir-P/vod/movie/cartoon//-p means to create a parent directory together
#ls-R/vod//recursive display directory

2. Create and modify files using vim
Format: VIM [[/directory/] file name]
If the destination file does not exist, create a new empty file and edit
If the destination file already exists, open the file and edit
Vim can only create text documents, cannot create directories
Command mode i key into input mode, ESC key return command mode
Command mode: Key into the last line mode
Enter WQ in the last line mode save and exit, enter q! Discard Changes and exit

Five. Copy, delete, move
1.RM Delete
Format: RM [options] File or directory
Common options:-r recursive Delete, delete the directory itself and its subdirectories
-F Force Delete
-I prompt to delete information when deleting (system default rm= ' Rm-r ')
Example: RM-RF/AA//forcibly delete all subdirectories and files under the AA directory
2.MV Move, rename
Format: MV [options] source file destination Path
Move: equivalent to cut
Rename: Path invariant movement
Example: Mv/opt/aa/xiaoha.txt/opt/bb//Cut xiaoha.txt into directory/opt/bb
Mv/opt/aa/xiaoha.txt/opt/aa/123.txt//rename xiaoha.txt to 123.txt

3.CP replication
Format: CP [option] source file destination Path
MV will let the source file disappear, CP will not let the source file disappear
Copy supports renaming at the same time
-r: Recursive copy, must have this option when copying directories
-P: Keep the source file permissions, modification time and other properties unchanged
Aliases for 4.alias--commands: Simplifying the input of complex commands
Example: Alias Myls = ' Ls-lh '
Remove alias: Unalias myls
Alias precedence is higher than instruction
Just enter alias to display the alias that is currently in effect
Temporarily de-alias: (valid only in the current command) add a backslash before the command
Force copy Directory (the principle is temporarily de-alias): \cp-r/boot//opt/
--Real on-machine alias modification (Permanent modification): Modify the configuration file/ROOT/.BASHRC, read the file every time it is turned on, and re-open the new terminal will be read again

Admin (ii)--linux command line Basics

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.