File system:
Rootfs: Root file system:
Fhs:linux
/boot: System boot related files, such as kernel, INITRD, and Grub (bootloader)
/dev: Device files
Device files:
Block devices: Random access, data blocks
Character Devices: Linear access, by character
Device number: Main device number (major) and secondary device number (minor)
/etc: Configuration file
Home directory for users, the home directory of each user is usually the default of/home/username
/root: Administrator's home directory;
/lib: library file
Static Library,. A
Dynamic libraries,. dll,. So (Shared object)//Share objects
/lib/modules: Kernel module files
/media: mount point directory, mobile device
/MNT: mount point directory, additional temporary file system
/OPT: Optional directory, installation directory for third-party programs
/proc: Pseudo file system, kernel mapping file
/sys: Pseudo file system, property mapping file related to hardware device
/tmp: Temp file,/var/tmp
/var: a variable file
/bin: Executable file, user command
/sbin: Managing Commands
Special files:
/usr:shared, read-only Global shared read-only file
/usr/bin
/usr/sbin
/usr/lib
/usr/local: Directory of third-party software installations (not required)
/usr/local/bin
/usr/local/sbin
/usr/local/lib
Naming rules for files:
1, the length can not exceed 255 characters;
2. Cannot use/when file name
3. Strictly case-sensitive
Relative path: Relative to the current location of the file lookup path or file reference path;
Absolute path: A file lookup or reference path starting from a more directory;
Linux Main operations
File Management
Directory Management
Run the program
Device Management
Process Management
Network management
Directory Management
Ls
Cd
Pwd
Tree: Check the directory tree under the current file to install it yourself (yum install tree)
mkdir Creating an empty directory recursively
-P:
-v:verbose: More information
-PV: Show details about the creation process
Practice:
/mnt/test/x/m,y
mkdir-pv/mnt/test/x/m/mnt/test/y
Mkdir-pv/mnt/test/{x/m,y}
Command line expansion:
/mnt/test2/
A_b, A_c, D_b, D_c
(a+d) (b+c) =AB+AC+DB+DC
{A,d}_{b,c}
RmDir (remove directory): Delete empty directory
-P: Recursive delete empty directory: not empty directory deleted
File creation and deletion
# Touch: Timestamp for modifying a file
-A: Change access time only
-M: Change the modification time only
-T: Specify the time of the file to a certain time (change the file's modification time to a certain time in the past: Touch–m–t file name)
-C,--no-creat: Do not create any files
Access: Accessing Time
Modify: Modification Time
Change: Changing Time
# Stat: Displays status information for a file or file system
To create a file, you can use the file editor (a Linux-brought text editor: Nano)
RM: Deleting files
-I: Interactive (general user will not prompt, only administrator user will be prompted)
-F: Forcibly removed
-R: Recursively delete all files in this directory
RM-RF: Recursively deletes all files under the directory and does not prompt
RM-RF/: Recursively deletes the root directory and all of its files without prompting
Practice:
1. Create a Directory
(1) Create boot and sysroot under/mnt;
(2) Create grub under/mnt/boot;
(3) Create proc, sys, bin, sbin, lib, usr, var, etc, Dev, home, Root, tmp under/mnt/sysroot
A) under/MNT/SYSROOT/USR, create Bin, Sbin, Lib
b) Create the modules under/mnt/sysroot/lib
c) Create run, log, lock under/mnt/sysroot/var
d) Create a init.d under/MNT/SYSROOT/ETC
Linux Primary Learning Note II: Linux operating system and common commands _mkdir_rm_touch_stat_tree, folder operation, file directory use, folder expansion! (Video serial number: 02_3)