Linux-basic concepts of file systems
In linux, all data is stored in a file and stored in a directory with a tree structure.
(1) file type
1. Common files
Including text files, source code files, and executable files. Linux does not distinguish between text and binary files.
2. Directory
Similar to the directory folder in windows.
3. Device Files
Character Device Files: Files starting with "c" can directly transmit data.
Block Device Files: Files starting with "B", read and write data blocks with memory buffer.
(2) viewing files
Command: ls-l
| Drwxrwxr-x |
2 |
Root |
Root |
4096 |
DEC 12 0910: 10 |
Reader |
| File Type |
Number of Files |
File owner |
Group |
File Size |
Creation or modification time |
File or directory name |
File Type: file attributes + 3 file owner permissions + 3 group permissions + 3 others Permissions
R: readable
W: writable
X: executable
(3) file editing
Command for creating or editing a file: vi filename
Vi editor mode: Command mode, edit mode, and end mode (you can enter the ex command)
Tip: After opening the file, enter I to enter the editing mode, click ESC to exit the editing mode, enter q to exit the file, and enter wq to save and exit the file.
(4) file operation commands
Cp: copy an object
Mv: Rename or move a file
Rm: delete an object