This chapter covers a total of 2 aspects: Linux file System architecture and several common commands (LS, CD, pwd, mkdir, rmdir, Touch, stat, RM, tree, CP, MV, install)
Linux File System architecture
/boot: The file to be used when the system starts. vmlinuz--kernel, initramfs--hard disk image file, Grub: Boot loader
/dev: Device files, no size, stored according to the metadata file, including access to some devices.
Block devices: Random access (for example: Hard disk) character devices: linear access (mouse, keyboard, screen, etc.) device number: Main device number and secondary device number
/etc: Configuration files, all text files
/home: The user's house directory, default to/home/usrname
/root:root's Home directory
/lib:library, library file
/lib/modules: Kernel module files
Static Library: Direct link to program Access address, as part of the program, in memory is not shared with other memory
Dynamic Library: Dynamic link library, can be called in memory by multiple programs, shared use
/lost+found: Abnormal switching machine saving
/MNT: mount point directory (mainly mobile device: CD-ROM, floppy disk, etc.)
/media: Mount point directory (additional temporary file mount point) access to media files must be mounted in a directory, open read and execute operations
/misc: Miscellaneous
/opt:optinal, optional catalogue, early risers for storing third-party software
/proc: Pseudo file system, kernel mapping file, kernel tunable parameters. (later system tuning and system detection mainly involves this file)
/sys: Pseudo file system, property mapping file related to hardware device
/tmp,/VAR/TMP: Temp file system
/var: a variable file
/bin:binary binary executable file, user command
/sbin: Manage Commands. These two are for system boot related instructions
/usr:shared,read-only, a global shared read-only file.
/usr/bin/usr/sbin applications that provide basic functionality after startup
/usr/local/bin/usr/local/sbin location of third-party software Installation
Naming rules for creating directories: 1, strictly case-sensitive
2. No more than 255 characters
3. Cannot use '/' when file name
mkdir: Creating a Directory
-P If the parent directory does not exist when the directory is created, create
-V Details display creation details
-----------------------------------------------------------------------------------------
[[email protected] tmp]# MKDIR-PV {a,b}/{c,d}
mkdir: The Directory "A" was created
mkdir: Created directory "A/C"
mkdir: Created directory "A/d"
mkdir: The directory "B" has been created
mkdir: The directory "B/C" has been created
mkdir: The directory "b/d" has been created
{}: Indicates expansion
RmDir: Delete directory. Remove directory. Only empty directories can be deleted
-P: Empty in the path is removed.
Creation and deletion of files
Touch: Create a directory (the directory under a folder cannot be duplicate with a file)
1. touch File name creation file
2. Modify Time stamp
-C Modify timestamp, no this file is not created
-A: Modify access time only
-M: Modify only modified time
-T: modified to a time in the past
Create a file with a text compiler. Nano
Stat: View property information for a file
Chinese standard: GB18030, GBK, GB2312
RM: Deleting files
-I: Interactive delete
-F: Force delete
-r: Delete directory, recursive delete
Copying and moving directories
Copy: Copies the directory. CP src Dest
CP file1 file2 .... filen the first one is the source and the last one is the target.
A file to a file, a file to a directory, multiple files to a directory.
-R: Recursive replication, that is, copying this directory and its subdirectories
-F: Forced override
-I: Replication reminders
-P: Retention timestamp, master and other information
-A: All attributes are reserved (when archived)
-d: Copy the link file as a link file, otherwise the linked file will be copied.
-L: Copy link file as text
MV:SRC dest
Move the file. A file into a directory, a file to a file (not present) then move and rename, file to file (present) Overwrite, directory to directory
Install: Copy files and set properties. Can only be a file
-W: Setting Permissions
-D: Create a Directory
This article is from the "ice is Asleep water" blog, please be sure to keep this source http://278893181.blog.51cto.com/3156502/1622320
Linux Basics 3