Linux common commands and Detailed
Delete files in the Linux system, create, change and other operations are to complete the operation we want through a different command, command what is it?
Able to complete certain tasks and operations of the input string all the characters in the user interface can be called in command. Strictly speaking, the name of the command usually represent a certain type of program instructions or implement functions.
Here we come to understand the classification system Linux commands what? The composition of the command line format What? Frequently used commands what?
Classification Linux commands
Internal command
Internal command means integrated inside special command interpreter program Shell, also referred to as a built-in command. Internal commands without having to re-read the file from the hard disk, so a higher efficiency.
External command
External command means in the Linux operating system can complete binary script file or a particular function, each external command corresponding to a file system, is part of the command interpreter program outside of the Shell, so called external command. Linux operating system must know the location of the external command file corresponding to be able to be loaded and executed by Shell.
Linux system command line format
Linux System Command Format
Command word [options] [parameters].
Is the name of the command word command: Command word
Options: At a command word followed by a single character or multiple characters, each representing a function
Parameters: command word processed, the command parameters typically may be a file name, path name or user name etc.
Linux auxiliary command
hot key | effect |
---|---|
TAB | Autocompletion |
Backslash "\" | Force a line break |
CTRL+U | To empty the beginning of the line |
CTRL+K | Clear lines to |
CTRL+L | Clear screen |
CTRL+C | Interrupt |
[Root @ localhost ~] # Comments
root: the current system login user
localhost: hostname
bin: Current location
#: Administrator
~: That home directory
cd command
cd: switching paths command
Command word | Options | effect |
---|---|---|
cd | “/” | Into the root directory |
cd | “..” | Return to the previous |
cd | "./" or "." | Current path |
cd | “-” | Switching path to the last execution path cd |
Get command help
help command
--help option
man Manual
Linux system commonly used commands
ls command
Command word | Options | effect |
---|---|---|
ls | -l | Show file |
ls | -h | The unit displays the file size, this option requires a combination of "-l" option is used with |
ls | -a | Show hidden files |
ls | -A | Show hidden files, but does not display "." ".." two special hidden directory |
ls | -R | (Recursive) |
ls | -i | View file node (Serial Number) |
pwd command
Command word | effect |
---|---|
Pwd | Display the working directory of the user's current location |
du command
Command word | Options | effect |
---|---|---|
of | -ah | Statistics include disk space occupied by all files, not just statistics directory. |
of | -sh | Only counts the total amount of space occupied by each parameter. |
makdir command
Command word | Options | effect |
---|---|---|
mkdir | Create a directory | |
mkdir | -p | Creating nesting |
Create a file command
Command word | effect |
---|---|
touch | Create a file (empty files) |
echo | Create a file to create the file contents |
vim | You can create file and enter edit content |
ln command
Command word | Options | effect |
---|---|---|
ln | Chong key hard-wired file | |
ln | -s | Create a soft link file |
- | Soft links (also known as symbolic links) | Hard-wired |
---|---|---|
After you delete the original file | Fail | Still available |
Use of | Use a file or directory in | Only available for file |
Save location | The original file can be located in different file systems | It must be the same as the original file in the file system (into a Linux partition) within |
cp command
Command word | Options | effect |
---|---|---|
cp | -f | Enforcement (copy) |
cp | -i | It will remind coverage |
cp | -p | Reserved rights to copy unchanged |
cp | -r | He expressed recursively, copying all the files and subdirectories |
rm command
Command word | Options | effect |
---|---|---|
Rm | -f | Not remind deleted |
Rm | -i | It will remind Delete |
Rm | -r | Recursive delete |
Rm | -rf | Remove completely |
mv command
Moving files or directories (cut and paste, rename indicates when moving the original directory)
which command
Find command file / file storage directory (which is able to distinguish between external command), the search range is determined by the PATH environment variable.
Location range specified command file system to identify where: environment variables (the PATH)
find command
Find Data File command (in order to find the range and achieve multiple lookup)
format
find [Look] [Find conditional expression]