Introduction to Linux
The Linux kernel was originally written by Finn Linus Torvalds out of personal hobby when he was at the University of Helsinki. Linux
is a free-to-use and freely disseminated Unix-like operating system. It is a multi-user, multi-task, multi-thread and multi-CPU
operating system based on POSIX and UNIX . Linux can run major UNIX tools, applications, and network protocols. It supports 32-bit and 64-bit hardware. Linux inherits
Unix's network-centric design philosophy and is a multi-user network operating system with stable performance.
Linux distribution
1. Linux system directory structure After
logging in to the system, enter the command in the current command window: ls
will display the following information:
The directory structure of Linux is an inverted tree with / as the root and the above directories as branches down Unfold.
The meaning of the above directory:
command | significance |
---|---|
/bin | Store frequently used commands |
/dev | Store Linux device files |
/ hoom | Home directory of ordinary users |
/ mnt | Temporary mount point |
/proc | Virtual directory, map the information in memory to this directory |
/run | Temporary file system, storing information since the system was started |
/srv | Store some data that needs to be extracted after the service is started |
/tmp | Store some temporary files |
/where | Store files that are frequently changed during system operation |
/boot | Kernel, files related to startup |
/etc | System configuration file |
/lib | System library files |
/media | Other devices, such as U disk, CD-ROM, etc., after identification, Linux will put the device in this directory |
/opt | Install additional software, empty by default |
/sbin | Programs and instructions that system administrators can use |
/sys | The file system is an intuitive reflection of the kernel device tree. When a kernel object is created, the corresponding files and directories are also in the kernel object subsystem |
/usr | Files that are not frequently changed during system operation |
… | … |
Two, Linux file types
file type | Means |
---|---|
Catalog file | d |
Normal file | - |
Pipeline file | p |
Link file | l |
Device file | c、b |
Socket file | s |
Three, Linux file permissions
d: Directory
r: Read permission 4
w: Write permission 2
x: Execution permission 1
s: Special permission (s has no execution permission S has execution permission) How
to change permissions:
1.chmod u, g, o + permissions to add+ File or directory name
2. chmod + number + file or directory name
For example: the owner of the main file has read and write execution permissions, the same group has write permissions, and the others only have read permissions
, the owner read (4) + write (2) + execute (1) = 7
Same reason, same group of people = 2
Others = 4
To change the permission of main, you can use chmod 724 main to complete it in one step.
Four. Linux commonly used commands
Processing directories: ls: list directories cd: switch directories pwd: display current directories mkdir: create a new directory rmdir: delete an empty directory cp: copy files or directories rm: remove files or directories mv: move files and Directory, or modify the names of files and directories.
Processing files: touch mkdir rm cp mv cat more tail vi vim awk sed find grep …
Processing: ps kill jobs & pkill
Processing monitoring: netstat top (cpu usage rate) free ss tcpdump lsof ipcs ipcrm