In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Pay attention to distinguishing the case of space symbols
Virtual machine password redhat
Systemctl restart service name restart service
Systemctl start service name start service
Systemctl stop service name stop service
Add the systemctl enable service name to the startup item
Systemctl status service name view service status
Systemd service name
Systemctl configuration name
Short format merge-a-l is merged into-al
Reboot restart service period
Poweroff shutdown
Ps View parameters
Ps-a-u-x merge ps aux to display process details
Free to check memory usage free-h
The name of the Who current user login
Last views login records for all systems
History view the history of command execution! + numeric execution of one of the commands seen above without spaces
History-c is clear about historical operation instructions
Sosreport is used to collect system configuration and architecture information and output diagnostic documents in sosreport format
Pwd shows that the current working directory format of the user is pwd {option}
Cd switch work path
Cd-the command returns to the directory where it was last located
Cd.. Command to enter the parent directory
Cd ~ command to switch to the current user's home directory
Cd ~ username changes to another user's home directory
The format of the file information in the ls display directory is ls [options] [files]
The ls-a parameter sees all the files
The ls-l parameter allows you to view the file's properties, size, and other details
After merging, ls-al displays the details of all files and files in the directory.
The cat command is used to view plain text files (with less content) in the format of "cat [options] [file]". If you want to display the line number by the way when viewing the text, you might as well append a-n parameter to the cat command.
More is used to view plain text files (those with more content) in the format of "more [options] file"
The head command is used to view the first N lines of a plain text document in the format "head [options] [File]"
The tail command is used to view the last N lines of a plain text document or to continuously refresh the contents in the format "tail [options] [File]"
The tr command is used to replace characters in a text file in the format "tr [original character] [target character]"
The wc command is used to count the number of lines, words, and bytes of specified text in the format "wc [parameter] text"
-l displays only the number of rows
-w displays only the number of words
-c displays only the number of bytes
The cut command is used to extract text characters by column, formatted as "cut [parameter] text"
The diff command is used to compare the differences of multiple text files in the format "diff [parameter] file"
The touch command is used to create a blank file or set the time of the file in the format "touch [options] [file]"
-a modify only "read time" (atime)
-m modify only the "modification time" (mtime)
-d modify both atime and mtime
The mkdir command is used to create a blank directory, and the format "mkdir [options] directory" mkdir command can also be combined with the-p parameter to recursively create a file directory with a nested stack relationship.
The cp command is used to copy a file or directory in the format "cp [options] source file destination file". You should be familiar with file copy operations. In Linux systems, copy operations can be divided into three types:
If the target file is a directory, the source file is copied to that directory
If the target file is also a normal file, you will be asked if you want to overwrite it
If the destination file does not exist, the normal copy operation is performed.
Parameter action
-p retains the attributes of the original file
-d if the object is a linked file, the properties of the linked file are retained
-r Recursive continuous replication (for directories)
-I ask whether to overwrite if the target file exists
-an is equivalent to-pdr (p, d, r are the above parameters)
The mv command is used to cut or rename files in the format "mv [option] source file [destination path | destination file name]" the cut operation is different from the copy operation, because it deletes the source file by default, leaving only the cut file.
The rm command is used to delete a file or directory in the format "rm [option] file" when deleting a file in the Linux system, the system will ask you by default whether you want to delete the file. If you do not want to see this repeated confirmation message all the time, you can follow the rm command with the-f parameter to force the deletion. In addition, if you want to delete a directory, you need to add a-r parameter to the rm command, otherwise it cannot be deleted.
The dd command is used to copy or convert files in the format of "dd [parameters]" according to the specified size and number of data blocks.
The parameters and functions of dd command
Parameter action
File name entered by if
File name of of output
Bs sets the size of each "block"
Count sets the number of "blocks" to copy
The file command is used to view the type of file in the format "file file name"
The tar command is used to package, compress or extract files in the format "tar [options] [files]".
Parameter action
-c create a compressed file
-x unzip the compressed file
-t to see what files are in the package
-z compress or decompress with Gzip
-j compress or decompress with bzip2
-v shows the process of compression or decompression
-f destination file name
-p retains the original permissions and attributes
-P uses absolute paths to compress
-C specifies the directory to which it is extracted
The grep command is used to perform a keyword search in text and display matching results in the format "grep [options] [File]"
Parameter action
-b search executable files (binary) as text files (text)
-c displays only the number of rows found
-I ignore case
-n display line number
-v reverse selection-lists only lines that do not have "keywords".
The find command is used to find files according to the specified criteria in the format of "find [find path] find conditional actions"
Find /-name file name
Parameter action
-name match name
-perm match permission (mode is an exact match,-mode is included)
-user matches the owner
-group matches all groups
-mtime-n + n match modification time (- n refers to within n days, + n refers to n days ago)
-atime-n + n matches the time to access the file (- n refers to within n days, + n refers to n days ago)
-ctime-n + n matches the time to modify file permissions (- n refers to within n days, + n refers to n days ago)
-nouser matches files without owners
-nogroup matches files without all groups
-newer F1! f2 matches files that are newer than file F1 but older than f2
-- type b/d/c/p/l/f matches the file type (followed by subtitle letters indicating block device, directory, character device, pipe, link file, text file)
-size matches the size of the file (+ 50KB is to find files that exceed 50KB, and-50KB is to find files less than 50KB)
-prune ignores a directory
-exec... {}\; can be followed by commands for further processing of search results (demonstrated below)
Cut-d spacer-f column number file name
$? Displays whether the execution value of the previous statement was successful
$if the previous is successful, execute the back.
| | if the previous failure occurs, execute the back. |
! Take reverse
Commands commonly used in Vim
Command function
Dd deletes (cuts) the entire line where the cursor is located
5dd deletes (cuts) 5 lines starting at the cursor
Yy copies the entire line where the cursor is located
5yy copies the five lines starting at the cursor
N displays the next string to which the search command is located
N displays the last string to which the search command was located
U undo the previous operation
P paste the previously deleted (dd) or copied (yy) data behind the cursor
The last-line mode is mainly used to save or exit the file and to set the working environment of the Vim editor. It also allows the user to execute external Linux commands or jump to a specific number of lines of the document being written. To switch to the last line mode, type a colon in command mode. The commands available in the last line mode are shown in Table 4-2.
Table 4-2 commands available in the last line mode
Command function
W save
Q exit
: q! Force exit (discard changes to the document)
: wq! Force save exit
: set nu displays the line number
: set nonu does not display line numbers
Command executes the command
: integer jumps to this row
: s/one/two replaces the first one on the line of the current cursor with two
S/one/two/g replaces all one on the line of the current cursor with two
:% s/one/two/g replaces all one in the full text with two
? String searches the string from the bottom up in the text
/ string searches the text for the string from top to bottom
When you open an practice.txt document, you enter the command mode of the Vim editor by default. At this time, we can only execute the command in this mode, but not enter the text content at will, we need to switch to the input mode to write the document. After entering the input mode, you can enter the text content at will, and the Vim editor will not execute the text content you enter as a command
The integer comparison operator only operates on numbers, cannot operate numbers with strings, files, etc., and cannot be judged by equal signs, greater than signs, less than signs, etc., which are taken for granted in daily life. Because the equal sign conflicts with the assignment command character, the greater than sign and the less than sign conflict with the output redirection command and the input redirection command, respectively. Therefore, it is important to use the canonical integer comparison operator. The available integer comparison operators are shown in Table 4-4.
Table 4-4 available integer comparison operators
Operator action
-is eq equal to
-whether ne is not equal to
-whether the gt is greater than
-whether the lt is less than
-whether le is equal to or less than
-whether ge is greater than or equal to
Linux user category
1: administrator root UID:0
2: system user UID:1~000
3: ordinary user UID: 1000 ~
Common directory names and corresponding contents in Linux system
The directory name should place the contents of the file
Files required for / boot boot-kernel, boot menu, required configuration files, etc.
/ dev stores any devices and interfaces in file form
/ etc configuration file
/ home user home directory
/ bin stores commands that can also be operated in single-user mode
The function library used when / lib starts up, and the functions to be called by the commands under / bin and / sbin
Commands required during startup of / sbin
/ media directory used to mount device files
/ opt places third-party software
/ root system administrator's home directory
/ srv the data file directory of some network services
/ tmp A "shared" temporary directory that anyone can use
/ proc virtual file system, such as system kernel, processes, external devices, network status, etc.
/ software installed by usr/local users themselves
Software / commands / scripts that will not be used when the usr/sbin Linux system is powered on
/ usr/share help and instructions files, or you can place shared files
/ var mainly stores frequently changing files, such as logs
/ lost+found when an error occurs in the file system, store some missing file fragments here
Naming rules for physical Devic
Common hardware devices and their file names
Hardware device file name
IDE device / dev/hd [aMurd]
SCSI/SATA/U disk / dev/sd [aMeip]
Floppy drive / dev/fd [0-1]
Printer / dev/lp [0-15]
Optical drive / dev/cdrom
Mouse / dev/mouse
Tape drive / dev/st0 or / dev/ht0
Parameters and roles in the mount command
Parameter action
-a Mount all file systems defined in / etc/fstab
-t specifies the type of file system
Fdisk command
In Linux systems, the most common way to manage hard disk devices is the fdisk command. The fdisk command is used to manage disk partitions in the format of "fdisk [disk name]". It provides a "one-stop partition service" with the functions of adding, deleting, converting partitions and so on. However, unlike the parameters written directly to the command explained earlier, the parameters of this command (see Table 6-5) are interactive, so they are particularly convenient for managing hard disk devices and can be dynamically adjusted according to demand.
Table 6-5 parameters and roles in the fdisk command
Parameter action
M to view all available parameters
N add a new partition
D Delete a partition information
L list all available partition types
T change the type of a partition
P View partition table information
W Save and exit
Q exit directly without saving
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.