Linux primary knowledge (command, file) file system
Under the Linux system, there is no drive disk, only one root directory/, all the files are under the root directory.
Related Folders Introduction
bin : Program-related
Boot : Boot-Start related
CDROM : Disc
Data : Dev Device related
etc : Configuration file-related
Lib : Some dependent libraries
Home : Home folder, home directory
How to use commandsLinux command format:
command [-option] [parameter].
- command name, corresponding function of the English word
- Option options, no sequencing
- Parameter parameters
View Help documentation
- Help: Typically Linux comes with information such as: Ls–help
- Man: There's a problem for men. A manual provided by Linux, which contains most of the commands, instructions for using the function
Auto-complete
TAB key Auto-complete
Historical command
History record which commands have been executed
! [Number] Execute the orders executed several times
Use arrows?? ?? View history Commands
Related catalog file commands
pwd: Current directory
ls: file in current directory
- -A show all file names
- -l Display as a list
- -h Display File size units
CD: Enter directory
Touch: Create a file to. The beginning is the hidden file
mkdir: Creating a Folder
Clear: Empty the terminal
Cat : View file content information
RM: Delete file, rm b-r Delete folder B and all files below it
- -F Force Delete
- -I executes interactively
- -R Recursively Delete the contents of the directory, you must add this parameter when deleting the folder
rmdir: Delete folder, only empty folder
wildcard character () : is a wildcard character, for example: LS-2 file with the beginning of listing
wildcard character (?) : for example: LS 2? List 2 start, followed by a file
wildcard characters [] : For example: LS 2[12345], listing 2 begins, followed by a [] file, is a regular expression
redirect
>
Example: ls > Xx.txt
The information to be displayed is written to the target file (the contents of the target file are deleted before writing)
>>
Writes the information to be displayed to the destination file, append write
Split screen Display more
For files with more text information, use more to split the screen view display
Example: Ls-alh/bin | More in the form of a list to display the files in the bin directory
Relative path and absolute path
- Relative path: Under Sibling directory
- Absolute path: Full directory path
- Cd.. /.. Top level Directory
- cd~ Home Directory
Create directory (mkdir)
To create a contiguous directory:
mkdir a/b/c/d/e-p
Tree-like display file directory structure
Linux first knowledge (commands, files)