Chapter 2 first logon and online man page
-
- In Linux, by default, hi provides six terminal ports for users to log on. The switchover mode is CTRL + ALT + F1 ~ F6 combination button. CTRL + ALT + F1 ~ F6: text interface login tty1 ~ Tty6; CTRL + ALT + F7: GUI desktop. In the default logon mode of Linux, there are two types: one is a logon environment with only a plain text interface (so-called run level3; the other is the logon environment of the graphic interface (the so-called run level5)
-
- Huzhiwei @ Ubuntu :~ $: Huzhiwei is the account of the current user, Ubuntu is the host name ,~ It refers to the current directory, and $ is the prompt.
-
- When executing a command in command line mode, there are two main situations: one is that the command will directly display the result and return to the command prompt to wait for the input of the next command; one is to enter the environment of the command, and only return to the environment of the command prompt after the command is completed.
-
- Important hotkey: tab has the functions of "command completion" and "file completion". tab is followed by the first command of a string of commands and is "command completion ", when the tab is connected to the second command of a string of commands, it is "file completion"; Ctrl + C interrupts the currentProgramCTRL + D usually indicates the end of the keyboard input, which is equivalent to exit.
- Man page: (1) after entering the man command function, you can use the space bar key to flip down the page, you can press the "Q" button to exit the man Environment (2) Date (1) the date in is the name of the command. (1) What does it represent. 1. commands or executable files that can be operated by the user in the shell environment; 2. Functions and tools that can be called by the system kernel; 3. common functions and function libraries, mostly C function libraries; 4. Description of device files, files normally under/dev; 5. Format of configuration files or certain files; 6. Games; 7. Conventions and Protocols; 8. management commands available to system administrators; 9. files related to the kernel. (3) man page content, brief command name and data Name Description; brief command execution syntax introduction of synopsis; complete description; Options for the synopsis section, there are descriptions of all the available options listed; commands that can be executed in this program when this program is being executed; files: some files used or referenced or connected to the program or data; see also commands or data with other instructions; exzmple other instructions for reference; whether the Bugs has related errors.
-
- /String query down string ,? String to query up string, N, N use N to continue the next query, use N for the previous query.
-
- Man-F (equivalent to whatis) and man-K (equivalent to apropos)
-
- View the system Usage Status: Who checks who is online, nestat-A checks the online status of the network, and PS-Aux checks the programs executed in the background.
6th ~ Chapter 9 main Commands
Shutdown command: Shutdown-H now (where H is equivalent to halt) shutdown-R now (R is equivalent to restart)
Change file attributes: Chgrp change file user group chown change file owner chmod change File Permission (u g o a)-R recursion for Recursive change
Copy: CP will copy the attributes and permissions of the performer (if no parameters are added during the copy, some attributes/permissions of the file will be changed, and even the creation time of the file will be different. To keep all the properties of the source file, you need to add the-a parameter;-R can copy the Directory;-s can be copied to the symbolic link, that is, the "shortcut" file)
Create an empty folder: Mkdir-P can create multi-level directories.
Delete the "empty" Directory: Rmdir-P can delete multiple levels of directories.
Create an empty file: Touch
Switch user: Su-User Name
Directory-related operations: CD ~ CD-CD. CD ..
Remove a file or directory: Rm-F indicates force. If a file does not exist, no warning is reported.-R deletes the file recursively.
MV: Move files and directories, or rename
View File Content directly: CAT (concatenate connection, making the chain) TAC more less NL tail head OD
Default File Permissions: Umask indicates "the permission to be removed by default ". File (-RW-) Directory (drwxrwxrwx)
Query script file names: Which command
Search for file names: Whereis (find a specific file) locate find
Disk and directory capacity: DF-H (displayed in easily readable formats such as GB, MB, and Kb)-I (displayed in inode quantity instead of hard disk capacity)
By default, du lists the sizes of all files in-s (listing the total amount instead of the size occupied by each individual directory)-M (listing the size in MB)
Connection file: ln hard link (hard connection or actual connection, hard link only creates a new file name in a directory to connect to the association record of an inode number. If you delete any "file name", inode and block still exist. The limitation of hard link is that it cannot be used across file systems or to connect to directories. Symbolic Link (symbolic connection, or shortcut) is used to create an independent file, this file causes Data Reading to point to the file name connected to it. Because the original file is deleted, the symbolic link file cannot be opened and the file cannot be opened ".
Compression:
Gzip-V displays the compression ratio of the source file/compressed file and other information-D decompression Parameters
Zcat can directly read compressed text files.
Bzip2-V can display the compression ratio of the source file/compressed file and other information-D decompression Parameters
Bzcat can directly read compressed text files
Tar-J uses the support of Bzip2 for compression and decompression. The file name is * .tar.bz2, and-Z uses the support of gzip for compression and decompression. The file name is * .tar.gz. Bzip2 compression is better than gzip.
-C compression: Create a new package file-x decompress-T query to check which file names contained in the package file can be used with-V to display the file names being processed
-F filename-F is followed by the processed file name. It is recommended that-F write a parameter separately. -C Directory: this parameter can be used to extract files from a specific directory.