Linux Architecture
The following are the Linux architectures:
In all Linux versions, the following key concepts are involved:
- Kernel: The kernel is the core of the operating system. The kernel interacts directly with the hardware and handles most of the lower-level tasks, such as memory management, process scheduling, file management, and so on.
- Shell:shell is a tool that handles user requests and is responsible for interpreting the commands entered by the user and invoking the program that the user wants to use.
- Commands and tools: In daily work, you will use many system commands and tools, such as CP, MV, Cat, and grep. In a Linux system, there are more than 250 commands, each command has multiple options, and there are many third-party tools, and they also play an important role.
- Files and directories: All the data in a Linux system is stored in a file, which is assigned to each directory to form the file system. The Linux directory is a similar concept to the Windows folder.
Change Password: passwd
View Current user information: WhoAmI
View current Online users: Who W
Log out: Logout
Shut down the system: halt
I. Document Management
In Linux, there are three basic file types:
1) Common documents
Normal files are data streams in bytes, including text files, source files, executable files, and so on. There is no difference between text and binary for Linux, and the interpretation of ordinary files is done by the application that handles the file.
2) Catalogue
Directories can contain normal files and special files, and directories are equivalent to folders in Windows and Mac OS.
3) device files
Linux and external devices (such as optical drives, printers, terminals, modern, etc.) are communicated through a file called a device file
Drwxr-xr-x Amrood amrood 4096 May 29 2007 desktop
File type file number owner user group file size last modified time file name or directory name
Second column: Indicates the number of files. If it is a file, then it is 1; if it is a directory, it is the number of files in that directory.
Each directory has a subdirectory "." and a sub-directory pointing to its parent directory ".", so for an empty directory, the second column should be 2.
Meta-characters * can match multiple characters. Match only one character Eg:¥ $ls Hel*.doc
View hidden files: ls-a
Create file: VI filename
Exit Edit: ESC or Shift+zz
View file contents: Cat filename and display line number: cat-b filename
Character statistics: WC filename Displays the number of rows, words, and characters
Copy file: CP source_filename Destination_filename
Renaming files: MV Oldname newname
Delete file: MV filename
Standard Linux Stream [ ]
in general, each Linux three file streams (three files) will be created when the program is run:
standard input Stream(stdin):stdinThe file descriptor is0,Linuxthe program defaults fromstdinread the data.
Standard output Stream(stdout):stdoutThe file descriptor is1,Linuxprogram defaults tostdoutoutput data.
standard error Stream(stderr):stderrThe file descriptor is2,Linuxthe program willstderrthe error message is written to the stream.
Three Linux directories
Absolute path: starts with/begins; relative path does not start with/
Go to home directory: CD ~ Return to current directory: CD-
Enter a directory: cd/home/pangyu/...
Get current directory: PWD
Create directory: mkdir
Create parent directory:-P mkdir
Delete directory: RmDir
Linux Learning Notes (i)