Linux Operating System Study Notes
The first time I came into contact with the Linux operating system, I only knew some simple commands. When I used them again at work, I had to relearn the knowledge and study the system. Now I will record it in the form of study notes, share some simple knowledge and personal opinions. If you have any mistakes, please note.
Basic knowledge:
Disk Partition in Linux:
For example, the/dev/hda5:/dev/directory stores the hardware device files. hd indicates the IDE device, sd indicates the SCSI device, and a indicates the sequence number of the hard disk, that is, the first disk is a, and the second disk is B... in windows, like drive C, drive d, 5 indicates the first logical partition. Linux partitions are composed of primary partitions and extended partitions. There are no more than four primary partitions. logical partitions are divided in extended partitions. Therefore, logical partitions start from 5, no matter whether the primary partition is full of four partitions, the first four are allocated to the primary partition.
Similarly, the representation of the second logical partition of the second hard disk Of a scsi device is/dev/sdb6.
File System Type:
In Linux, the default file system type is EXT3 (EXT4) and SWAP. It also supports other file system types, such as FAT16, FAT32, NTFS, and XFS.
Directory structure:
Top-level: root directory (/). Several important directories under the root directory are:/root,/bin,/boot,/etc,/home,/var,/usr, /tmp ..... (What content is important for each directory)
Switching between the graphic and character operation interfaces:
Graphical interface --> character terminal: Ctrl + Alt + Fn (n value 1 ~ 6. I will explain why in my subsequent notes)
Character terminal --> character terminal: Alt + Fn
Character terminal --> graphic interface: Alt + F8
After logon, if it is a root user, the prompt is "#". If it is a common user, the prompt is "$"
Shutdown and restart command:
Restart: shutdown-r now
Shutdown-r + 15 "Warning: the system will restart in 15 minutes"
The reboot command also indicates a restart, but the difference with shutdown is that it is mandatory to restart, And the shutdown command will prompt the user to save it. Therefore, we recommend that you use the shutdown command.
Shutdown: shutdown-h now or halt
Start to execute some simple commands:
Note that Linux is sensitive to uppercase and lowercase letters, which is different from windows. powershell in windows is case-insensitive for both commands and function methods.
[Www.bkjia.com @ localhost ~] $ Su-root switch to the root user password: [root @ localhost ~] # After switching to root, the prompt is # [root @ localhost ~] # Date: Display date and Time: Tuesday, January 1, March 05, 2013 21:09:09 CST [root @ localhost ~] # Echo $ LANG display currently supported language zh_CN.UTF-8 [root @ localhost ~] # LANG = en_US language [root @ localhost ~] # Echo $ LANGen_US [root @ localhost ~] # Cal view current month calendar March 2013 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 910 11 12 13 14 15 1617 18 19 20 21 22 2324 26 26 26 27 28 29 3031 [root @ localhost ~] # Bc open the calculator bc 1.06 Copyright 1991-1994,199 7, 1998,200 0 Free Software Foundation, Inc. this is free software with absolutely no warranty. for details type 'warranty '. 4*312 press the quit key to exit [root @ localhost ~] #
In addition, it is helpful to master some common hotkeys to speed up the command, such as Tab (automatically filled, and when no command is available, if you press the TAB twice, all the commands will appear, this can also be used as a help .); Ctrl + C: interrupt the current running program; Ctrl + D: Enter the keyboard to end, the same as Exit; Ctrl + L: clear screen; Ctrl + U to clear the first line; Ctrl + K: clear to the end of the line; "\": force line feed.
Linux Command help:
If you press the TAB key twice without executing any command, all available commands are displayed. This method is not commonly used. The commonly used method is help, and the usage is: Command -- help, commonly used is man help (that is, manual), which is used as the man command. Another help method is info, which is rarely used, generally, man can solve most problems.
In addition, when the man or info command is used, multiple pages may appear. Sometimes you don't want to read more pages. At this time, press q to exit the help. In addition, due to the fact that there is a lot of information, how can you quickly find what you want? enter "/the character you want to search for" and press enter.
You can view the role of a command: whatis command
You can also view where a command is stored: which command (except cd, because cd is embedded in the kernel)
Switch execution level:
View running level: runlevel
Level 0: Shutdown (the command init 0 can be used to shut down. The init process will be described in the following notes)
Level 3: pure command line mode, that is, the terminal character mode that we right-click on the graphic interface
Level 5: graphical interface mode (this level is basically not enabled as a server, and it enters level 3 character mode directly)
Level 6: restart (restart the available command init 6)
Level 1 indicates single-user mode, level 2 indicates multi-user mode on the Character interface, and Level 4 is not allocated for use. These three levels are basically not used. Therefore, you only need to know the above four levels. The specific Startup Process and configuration file will be reflected in subsequent notes.
Linux Command classification:
(Linux commands: commands or programs used to implement a function. Command Execution depends on interpreter programs, such as/bin/bash)
Internal commands: part of the Shell interpreter (can be understood as the commands contained in bin)
External command: A program independent of the Shell interpreter (that is, it can be executed without/bin/bash, such as Vim and LVM)
Linux Command Format:
Command word [Option] [parameter] Option: it is used to adjust the specific function parameters of a command: the object of a command operation, such as files and directories. The options in multiple segment formats can be written together and connected by.
Finally, I think the problem to be clarified is the linux shell. In fact, shell is an interface between the Kernel and the user, and the user will not directly deal with the Kernel, however, the commands entered by the user will be recognized by the kernel, which is the role of shell.
For more details, please continue to read the highlights on the next page:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- Next Page
|
[Content navigation] |
Page 1: getting started |
Page 2nd: File/directory/VIM |
Page 3rd: permission management |
Page 1: Manage disks and file systems |
Page 1: Processes and scheduled tasks |
Page 1: application installation |
Page 7: Shell first recognized |
Page 1: simple shell syntax |