This is the first day of my participation in the August More text Challenge. For details, see: August More Text Challenge

A lifelong learner, practitioner, and sharer committed to the path of technology, an original blogger who is busy and sometimes lazy, and a teenager who is occasionally boring and sometimes humorous.

Welcome to search “Jge’s IT Journey” on wechat!

99% of Linux operation and maintenance engineers must master the command and use

Linux command

I. File management

1.1 CD

Syntax: CD [dirName]

Run the following command to change the current working directory to dirName(directory parameter).

Note: dirName can be an absolute path or a relative path. If the directory name is omitted, it is converted to the user’s home directory (which is the same directory as when you first login). In addition, “~” also means the home directory, “.” means the current directory, “..” Is the directory at the next level above the current directory location.

1.2 the ls

Syntax: ls [-alrtafr] [name…]

Function: Used to display the contents of the specified working directory (list the files and subdirectories contained in the current working directory).

Parameters:

  • -a displays all files and directories (ls internally considers file names or directories whose names start with “.” as hidden files and will not be listed)

  • -l Specifies the file type, permissions, owner, and file size in addition to the file name

  • -r displays files in reverse order (originally in alphabetical order)

  • -t Lists the files in the order of creation time

  • -a is the same as -a, but does not list “.” (current directory) and “..” (Parent directory)

  • -f Adds a symbol to the name of the listed file. For example, “*” for executables and “/” for directories

  • -r If there are files in the directory, the following files are also listed in sequence

1.3 the PWD

Syntax: PWD [–help] [–version]

Function: Displays the working directory.

Parameters:

  • –help Online
  • –version Displays the version information

1.4 the mkdir

Syntax: mkdir [-p] dirName

Run the following command to create a subdirectory named dirName.

Parameters:

  • -p Makes sure the directory name exists. If it doesn’t, create one

1.5 rmdir

Syntax: rmdir [-p] dirName

Run the following command to delete an empty directory.

Parameters:

  • -p is when the subdirectory is deleted to make it also empty

1.6 the cat

Syntax: cat [-abeensttuv] [–help] [–version] fileName

Function: Used to connect files and print to the standard output device.

Parameters:

  • N or –number: the number of all output lines starting with 1
  • -b or –number-nonblank: Similar to -n, except that blank lines are not numbered
  • -s or –squeeze-blank: When there are more than two consecutive blank lines, replace them with a single line of blank
  • -v or –show-nonprinting: Use ^ and M- symbols, except for LFD and TAB
  • -e or –show-ends: displays $at the end of each line
  • -t or –show-tabs: displays the TAB character as ^I
  • -e: is equivalent to -ve
  • -a, –show-all: equivalent to -vet
  • -e: is equivalent to the “-ve” option
  • -t: is equivalent to the “-vt” option

1.7 chmod

Syntax: chmod [-cfvr] [–help] [–version] mode file…

Function: Controls how files are invoked by others.

Parameters:

  • -c: Displays the change action only when the file permission has been changed
  • -f: Do not display an error message if the file permission cannot be changed
  • -v: displays detailed information about permission changes
  • -r: Make the same permission change for all files and subdirectories in the current directory (that is, change them one by one in a recursive way)
  • –help: displays supplementary instructions
  • –version: displays the version

1.8 chown

Grammar: chown [- cfhvR] [– help] [– version] user [: group] file…

Run the following command to change the owner of a specified file to a specified user or group. The user can be a user name or user ID. A group can be a group name or a group ID. A file is a whitespace separated list of files whose permissions are to be changed. Wildcard characters are supported.

Parameters:

  • User: user ID of the new file owner
  • Group: user group (group) of the new file owner
  • -c: displays the information about the changed part
  • -f: ignores the error information
  • -h: fixes symbolic links
  • -v: displays detailed processing information
  • -r: Processes all files in the specified directory and its subdirectories
  • –help: displays supplementary instructions
  • –version: displays the version

1.9 the file

Syntax: file [-bclvz] [-f < name file >] [-m < Magic digital file >…] [file or directory…]

Function: Identifies file types.

Parameters:

  • -b: The file name is not displayed when the identification result is listed
  • -c: displays the instruction execution process in detail to facilitate troubleshooting or analysis of program execution
  • -f< Name file > : Specifies a name file. If the file contains one or more file names, the file is identified in order. The format is one file name for each column
  • -l: displays the category of the file to which the symbolic link points
  • -m< Magic digital file > : specifies the magic digital file
  • -v: displays the version information
  • -z: Attempts to read the contents of the compressed file
  • [file or directory…] To determine the type of file list, multiple files are separated by Spaces, and you can use shell wildcards to match multiple files

1.10 the find

Syntax: find path-option [-print] [-exec-ok command] {};

Function: Used to search for files in the specified directory.

Parameters:

  • -name: searches for a file by file name
  • -amin n: The device has been read within the last n minutes
  • -anewer file: indicates the files that are read later than file
  • -atime n: indicates the files that have been read in the last N days
  • -cmin n: indicates that the value is modified within the last N minutes
  • -cnewer file: indicates the file that is newer than file
  • -ctime n: indicates the file that has been modified in the last N days

1.11 ln

Syntax: ln [parameter] [source file or directory] [destination file or directory]

Function: Create a synchronous link for a file in another location.

Parameters:

  • -b: deletes and overwrites previously established links
  • -d: Allows the superuser to make hard links to directories
  • -f: Forcible execution
  • -i: indicates the interactive mode. If a file exists, the system prompts the user whether to overwrite the file
  • -n: Treats symbolic links as general directories
  • -s: soft link (symbolic link)
  • -v: displays the detailed processing process
  • -s: “-s < end backup string >” or “–suffix=< end backup string >”
  • -v: “-v < backup mode >” or “–version-control=< backup mode >”
  • –help: displays help information
  • –version: Displays the version information

Soft links:

  • Soft links: Exist as paths, similar to shortcuts in the Windows operating system.
  • Soft links can cross file systems, hard links cannot.
  • Soft link: you can link a file name that does not exist.
  • Soft link: can link to the directory;

Hard links:

  • Hard link: Exists as a copy of a file. But it doesn’t take up real space;
  • Hard links to directories are not allowed.
  • Hard links can only be created in the same file system.

1.12 less

Syntax: less [parameter] file

Function: You can browse files at will, while more can only move forward, but not backward, and less does not load the entire file before viewing.

Parameters:

  • -b: < Buffer size > Sets the size of the buffer
  • -e: Automatically leaves after the file is displayed
  • -f: forces you to open special files, such as peripherals, directories, and binary files
  • -g: indicates only the last searched keyword
  • -i: ignores the case of the search
  • -m: Displays the percentage of more commands
  • -n: displays the line number of each line
  • -o: < file name > Saves the output of less in the specified file
  • -q: The warning tone is not used
  • -s: Displays one row of consecutive empty behaviors
  • -s: If the line is too long, the excess part will be discarded
  • -x: < number > Displays the “TAB” key as the specified numeric space
  • / String: Search down for “string”
  • ? String: The ability to search up for “string”
  • N: Repeat the previous search (with/or? The relevant)
  • N: Reverse repeat the previous search (with/or? The relevant)
  • B: Turn back the page
  • D: Turn back half the page
  • H: Displays the help interface
  • Q: Exit the less command
  • U: Scroll forward half a page
  • Y: Scroll forward a line
  • Space bar: scroll a page
  • Enter: scroll a line
  • [pageDown] : Scroll down a page
  • [pageup] : Turn up a page

1.13 lsattr

Syntax: lsattr [-adlrvv] [file or directory…]

Function: Displays file properties.

Parameters:

  • -a: Displays all files and directories, including the additional built-in characters that start with a “.”, the current directory “.” and the upper directory “..”
  • -d: displays the directory name, not its contents
  • -l: This parameter has no effect at present
  • -r: recursive processing. All files and subdirectories in the specified directory are processed together
  • -v: displays the version of a file or directory
  • -v: displays the version information

1.14 mv

Grammar:

mv [options] source dest

mv [options] source... directory
Copy the code

Function: Rename a file or directory, or move a file or directory to another location.

Parameters:

  • -i: If a file with the same name already exists in the specified directory, the system asks whether to overwrite the old file.
  • -f: No indication is given when the mv operation overwrites an existing object file.

1.15 the RCP

Syntax: RCP [-pr] [source file or directory] [target file or directory]

Function: Used to copy remote files or directories.

Parameters:

  • -p: retains the attributes of the source file or directory, including the owner, owning group, permission, and time
  • -r: recursive processing. Files in the specified directory and subdirectories are processed together

1.16 the rm

Syntax: rm [options] name…

Function: Delete a file or directory.

Parameters:

  • -i: confirm the deletion one by one
  • -f: Deletes the original file even if the file attribute is set to read only
  • -r: Delete the directory and the following files one by one

1.17 touch

Grammar: touch [- delivered acfm per input horsepower] [-d < date/time >] [-r < > reference file or directory] t < date/time > [-] [– help] [– version] […] file or directory

Function: Used to modify the time attribute of a file or directory, including access time and change time. If the file does not exist, a new file is created.

Parameters:

  • -a: changes the file read time record
  • -m: changes the modification time record of the file
  • -c: No new file will be created if the destination file does not exist, the same effect as –no-create
  • -f: Not used. It is reserved for compatibility with other Unix systems
  • -r: Use the reference time record, which has the same effect as –file
  • -d: sets the time and date in a variety of formats
  • -t: sets the time record of the file. The format is the same as that of the date directive
  • –no-create: No new files will be created
  • –help: lists the instruction format
  • –version: Lists the version information

1.18 which?

Syntax: which [file…]

Function: Used to find files.

Parameters:

  • -n< File name length > : specifies the length of the file name. The length must be greater than or equal to the longest file name
  • -p< filename length > : this parameter is the same as the -n parameter, except that < filename length > includes the path of the file
  • -w: Specifies the width of the output field
  • -v: displays the version information

1.19 the cp

Syntax: cp [options] source… directory

Function: Used to copy files or directories.

Parameters:

  • -a: This option is usually used when copying a directory. It preserves links and file properties and copies all contents in the directory
  • -d: the link is preserved during replication. Links are the Windows equivalent of shortcuts
  • -f: Overwrites an existing destination file without prompting
  • -i: Contrary to the -f option, the system prompts the user to confirm whether to overwrite the target file before overwriting it
  • -p: Copies not only the contents of the file, but also the modification time and access permission to the new file
  • -r: If the source file is a directory file, all subdirectories and files under the directory will be copied
  • -l: does not copy files, but generates link files

1.20 the SCP

SCP [Optional] file_source file_target

Function: Used to copy files and directories between Linux.

Parameters:

  • -b: Use batch mode (transmission password or phrase is not asked during transmission)
  • -c: Allow compression (pass the -c flag to SSH to enable compression)
  • -p: retains the modification time, access time, and access permission of the original file
  • -q: The transfer progress bar is not displayed
  • -r: recursively copies the entire directory
  • -v: displays the output in detail. SCP and SSH display debugging information for the entire process. This information is used to debug connections, validate, and configure problems
  • -c cipher: Uses the cipher to encrypt data transmission. This option is directly transmitted to SSH
  • -f ssh_config: specifies an alternative SSH configuration file. This parameter is passed directly to SSH
  • -i identity_file: reads the key file used for transmission from the specified file. This parameter is passed directly to SSH
  • -l limit: specifies the bandwidth that can be used by a user. The unit is Kbit/s
  • -o ssh_option: If you are used to using the parameter passing method in ssh_config
  • -p port: specifies the port number used for data transfer

1.21 read

Syntax: read [-ers] [-a aname] [-d delim] [-i text] [-n nchars] [-n nchars] [-p prompt] [-t timeout] [-u fd] [name…

Function: Used to read values from standard input.

Parameters:

  • -a: followed by a variable that is considered to be an array and assigned to it. The default separator is space
  • -d: is followed by an identifier. In fact, only the first character after it is useful as a closing flag
  • -p: a prompt message is displayed before input
  • -e: Indicates the command completion function when input
  • -n: followed by a number, defining the length of the input text, very useful
  • -r: mask \. If not, \ is used as an escape character. Otherwise, \ is a normal character
  • -s: Indicates the quiet mode. Characters are not displayed on the screen when you enter a character, for example, the password when you enter login
  • -t: specifies the waiting time for input characters, followed by seconds
  • -u: followed by fd, read from the file descriptor

1.22 the wc

Syntax: wc [-clw] [-help] [-version] [file…]

Function: Used to calculate the word count.

Parameters:

  • -c or –bytes or –chars Displays only bytes
  • -l or –lines displays only the number of lines
  • -wor –words displays only the number of words
  • –help: Online help
  • –version: Displays the version information

1.23 the grep

Syntax: grep [op] pattern file

Function: Used to filter/search for specific characters. You can use regular expressions together with various commands

Parameters:

  • -c: displays everything before and after the line except the line that matches the style
  • -i: ignores the difference in case
  • -l: lists the names of files whose contents match the specified styles
  • -n: Indicates the column number of the row before displaying the row that matches the style

1.24 tail

Syntax: tail [parameter] [file]

Function: View file contents.

Parameters:

  • -f: reads in loops
  • -q: No processing information is displayed
  • -v: displays detailed processing information
  • -c< Number > : indicates the number of bytes to be displayed
  • -n< Line number > : indicates the number of lines to be displayed
  • –pid= Pid is used with -f, indicating that the process is terminated after the process ID and PID die
  • -q, –quiet, –silent never outputs the header of the file name
  • -s, –sleep-interval=S and -f are used together, indicating that the sleep interval is s seconds

1.25 the tar

Syntax: tar [op] dirName

Function: Used to compress and decompress files.

Parameters:

  • -a: adds the compressed file to the existing compressed file
  • -c: creates a new compressed file
  • -d: records the differences between files
  • -r: adds a file to an already compressed file
  • -u: Adds changed and existing files to an existing compressed file
  • -x: extracts files from compressed files
  • -t: displays the contents of the compressed file
  • -z: Supports gZIP decompression files
  • -v: displays the operation process
  • -k: retain the original file
  • -m: The file is not overwritten
  • -w: Verifies the correctness of the compressed file
  • -c: switches to the specified directory
  • -f: specifies the compressed file

Two, system management

2.1 ps

Syntax: ps [options] [–help]

Function: Displays the status of the current process.

Parameters:

  • -A: List all the trips

  • -w: Widens the display to display more information

  • -au: displays detailed information

  • -aux: displays all trips that include other users

  • Au (x) Output format:

    USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
    Copy the code
  • USER: itinerary owner

  • PID, PID

  • %CPU: Indicates the CPU usage

  • %MEM: Indicates the memory usage

  • VSZ: The size of the occupied virtual memory

  • RSS: Memory size occupied

  • TTY: Minor device number of TTY.

  • STAT: Status of the trip:

  • D: Continuous rest (I/O)

  • R: The command is being executed

  • S: Static state

  • T: Suspend execution

  • Z: It doesn’t exist but it can’t be eliminated

  • W: There are not enough memory pages to allocate

  • < : High priority stroke

  • N: Low priority travel

  • L: There is paging of memory allocated and locked in memory (real-time system or A I/O)

  • START: indicates the START time of the trip

  • TIME: indicates the execution TIME

  • COMMAND: indicates the COMMAND executed

2.2 the kill

Syntax: kill [-s < message name or number >] [program] or kill [-l < message number >]

Function: Used to delete programs or work in execution.

Parameters:

  • -l < Information number > : If the < information number > option is not added, the -l parameter lists all information names
  • -s < Message name or number > : specifies the message to be sent

2.3 the clear

Syntax: clear or shortcut: CTRL + L

Function: Clears the screen.

2.4 the top

Grammar: top

Run the following command to dynamically display information about the processes that are running in the current system.

Parameters:

  • -i+ time: sets the interval
  • -u+ User name: specifies a user name
  • -p+ Process ID: specifies a process
  • -n+ Times: Indicates the number of times the loop is displayed

2.5 the history

Grammar: the history

Run the following command to query the command history.

Parameters:

  • -c: clears all command history

2.6 the su

Grammar: su [- FMP] [-c command] [-s shell] [– help] [– version] [-] [USER [ARG]]

Function: Used to change the identity of another user except root. You need to enter the password of this user.

Parameters:

  • -f or –fast does not require reading the startup file (such as csh.cshrc) and is used only for CSH or TCSH
  • -m-p or –preserve-environment The environment is not changed after su is executed
  • -c Changes to the USER whose account is USER and executes commands to change back to the original USER
  • -s shell or –shell=shell specifies the shell to execute (bash CSH TCSH, etc.). The default value is the USER shell in /etc/passwd
  • –help: displays the description file
  • –version: displays the version information
  • When the -l or –login parameter is added, it is as if you are re-login to the USER. Most environment variables (HOME SHELL USER, etc.) are based on the USER, and the working directory is changed. If no USER is specified, root is fixed
  • USER Indicates the USER account to be changed
  • ARG passes in the new shell parameter

2.7 the who

Syntax: who – [husfV] [user]

Function: Used to display which users are on the system;

Parameters:

  • -h: displays the title column of each column
  • -i: displays the idle time. If the user has taken any action in the last minute, the string is marked with a “.”; if the user has not taken any action for more than 24 hours, the string is marked with an “old”
  • -m: This parameter has the same effect as specifying the “am I “string
  • -q: Displays only the account names and the total number of users who have logged in to the system
  • -s: This parameter is ignored and is only used to solve compatibility problems with other versions of the WHO directive
  • -w: displays the status bar of the user
  • –help: Online help
  • –version: Displays the version information

2.8 reboot

Syntax: reboot [-n] [-w] [-d] [-f] [-i]

Function: Used to restart the computer.

Parameters:

  • -n: does not write the memory data back to the hard disk before the restart
  • -w: Does not actually restart, but writes records to /var/log/wtmp
  • -d: do not write records to /var/log/wtmp
  • -f: forcibly restart the system without calling shutdown
  • -i: Stop all network-related devices before restarting

2.9 shutdown

Syntax: shutdown [-t seconds] [-rkhncff] time [message]

Function: Used for shutdown procedure.

Parameters:

  • -t seconds: specifies a few seconds after the shutdown process
  • -k: Does not actually shut down, but sends a warning message to all users
  • -r: Power on after shutdown
  • -h: Shutdown after shutdown
  • -n: Shutdown by forcing all programs in execution to be killed instead of using normal procedures
  • -c: cancel the shutdown
  • -f: Do not perform the FCSK action when shutdown (check the Linux file system)
  • -f: Forces the FSCK action when the device is powered off
  • Time: Set the shutdown time
  • Message: Warning message sent to all users

2.10 procinfo

Syntax: procinfo [-abddfhimssv] [-f < output file >] [-n < interval seconds >]

Function: Displays the system status.

Parameters:

  • -a: displays all information
  • -b: Displays the number of blocks on the disk device, not the number of accesses
  • -d: displays the difference between the changes of system information per second instead of the total value. This parameter must be used with the “-f” parameter
  • -d: This parameter has the same effect as specifying the “-d” parameter, except that the memory and swap file information is the sum value
  • -f: Displays a full-screen interactive operation interface
  • -f < Output file > : Output the information status to a file for saving, rather than the default standard output device
  • -h: Online help
  • -i: displays the complete LIST of IRPs
  • -m: Displays information about system modules and peripheral devices
  • -n< interval seconds > : Sets the information update speed of the full screen interactive mode, in seconds
  • -s: Displays the system memory, disk space, IRP, and DMA information. This is the default value
  • -s: When “-d” or “-d” is used, the information is updated every second, regardless of whether the “-n” parameter is used.
  • -v: displays the version information

Iii. Network management

3.1 the ifconfig

Grammar: Ifconfig [network device] [down up-allmulti-arp-promisc] [add< address >] [del< address >] [< hardware address >] [io_addr] [irq] [media< network media type >] [mem_start< memory address >] [metric< number >] [mtu< bytes >] [netmask< subnet mask >] [tunnel< address >] [-broadcast< address >] [-pointopoint< address >] [IP address]

Function: Displays or sets network devices.

Parameters:

  • Add < Address > : sets the IPv6 IP address of the network device
  • Del < Address > : deletes the IPv6 IP address of a network device
  • Down: Disables the specified network device

  • < Hardware Address > : Sets the network device type and hardware address
  • Media < Network media type > : sets the media type of the network device
  • Mem_start < Memory address > : sets the start address used by the network device in the main memory
  • Metric < number > : Specifies the number to be added when calculating the number of times packets are forwarded
  • Mtu < bytes > : Sets the MTU of a network device
  • Netmask < Subnet mask > : sets the subnet mask of the network device
  • Tunnel < address > : indicates the communication address of the tunnel between IPv4 and IPv6
  • Up: Starts the specified network device
  • -broadcast< address > : packets to be sent to a specified address are treated as broadcast packets
  • -pointopoint< address > : establishes a direct connection with the network device at the specified address. This mode has the security function
  • -promisc: disables or enables the promiscuous mode of a specified network device
  • [IP address] : specifies the IP address of a network device
  • [Network device] : Specifies the name of a network device

3.2 the ping

Grammar: Ping [- dfnqrRv] [-c < complete number >] [-i number > < seconds] [- I < > network interface] [-l < pre > loaded] [-p < style > model] [- small < > packet size] [- tons of numerical > < live] [Host name or IP address]

Run the following command to check host connectivity.

Parameters:

  • -d: Uses the SO_DEBUG function of the Socket
  • -c < Completion times > : sets the number of times to complete the required response
  • -f: indicates limit detection
  • -i < Interval seconds > : specifies the interval for sending and receiving information
  • -i < Network interface > : sends packets using the specified network interface
  • -l < preload > : Sets the packet to be sent before the requested information is sent
  • -n: Displays only values
  • -p < Template style > : Sets the template style for filling packets
  • -q: The command execution process is not displayed, except the beginning and end information
  • -r: Ignores the common routing table and directly sends packets to the remote host
  • -r: records the routing process
  • -s < Packet size > : sets the packet size
  • -t < TTL value > : sets the TTL value
  • -v: displays the detailed execution process of the command

3.3 telnet

Syntax: Telnet [op] [IP or domain name] [port]

Function: Used for remote login.

3.4 the netstat

Syntax: netstat [-accefghilmnNoprstuvvwx] [- < network type >] [-ip] [-accefghilmnNoprstuvvwx] [-a < network type >] [-ip]

Functions: Used to display the network status;

Parameters:

  • -a (all) : displays all options. By default, list-related options are not displayed
  • -t (TCP) : Displays only TCP related options
  • -u (udp) : Displays only UDP related options
  • -n: refuses to display aliases. All numbers that can be displayed are converted to numbers
  • -l: Lists only the service status in Listen
  • -p: displays the name of the program that established the related link
  • -r: displays routing information and routing table
  • -e: displays extended information, such as the UID
  • -s: collects statistics by protocol
  • -c: Run the netstat command at a fixed interval

3.5 wget

Syntax: wget(option)(argument)

Function: Used to download files from the specified URL.

Parameters:

  • -a< log file > : records the data execution in the specified log file
  • -a < Name extension > : specifies the name extension of the file to be downloaded. Multiple name extensions are separated by commas (,)
  • -b: Runs wget in background mode
  • -b < Connection address > : sets the base address of the reference connection address
  • -c: continues the task of the last terminal
  • -c < flag > : Sets the flag of the server data block function to on and off respectively. The default value is ON
  • -d: indicates running commands in debug mode
  • -d < domain name list > : Sets the following domain name list, separated by commas (,)
  • -e< instruction > : Executes the specified instruction as part of the.wgetrc file
  • -h: displays the help information about the command
  • -i< file > : obtains the URL to be downloaded from the specified file
  • -l< Directory list > : Set the directory list along the list. Multiple directories are separated by commas (,)
  • -l: follows only the associated connection
  • -r: recursively download
  • -nc: The downloaded file does not overwrite the original file if the file exists
  • -nv: Only update and error information are displayed, but the detailed execution process of the command is not displayed
  • -q: The command execution process is not displayed
  • -nh: does not query the host name
  • -v: displays the detailed execution process
  • -v: displays the version information
  • –passive-ftp: Connects to the FTP server in PASV mode
  • –follow-ftp: Download the FTP connection file from the HTML file

Iv. Disk management

4.1 df

Syntax: df(option)(parameter)

Function: Displays the available disk space on the disk partition. The default unit is KB.

Parameters:

  • -a: contains all file systems
  • –block-size=< block size > : Displays the number of blocks with the specified block size
  • -h: displays information in a readable manner
  • -h: The value is the same as -h, but is calculated in 1000 Bytes instead of 1024 Bytes
  • -i: displays inode information
  • -k: specifies the block size of 1024 bytes
  • -l: Displays only the local file system
  • -m: Specifies the block size of 1048576 bytes
  • –no-sync: Do not execute the sync command before obtaining the disk usage information. This command is the default value
  • -p: Indicates the POSIX output format
  • –sync: Run the sync command before obtaining the disk usage information
  • -t< file system type > or –type=< File system type > : Displays only the disk information of the specified file system type
  • -t: displays the type of the file system
  • -x< file system type > or — exclud-type =< file system type > : Do not display information about disks of a specified file system type
  • –help: displays help
  • –version: Displays the version information

4.2 the du

Syntax: du [op] [file]

Function: Displays the size of a directory or file

Parameters:

  • -a: displays the size of individual files in the directory
  • -b: Displays the size of a directory or file in bytes
  • -c: Displays not only the size of individual directories or files, but also the sum of all directories or files
  • -d: Displays the size of the source file for the specified symlink
  • -h: indicates that the unit is K, M, or G, which improves information readability
  • -h: Same as -h, but K, M, and G are in units of 1000
  • -k: 1024 bytes
  • -m: the unit is 1MB
  • -s: Displays only the total

4.3 fdisk

Syntax: fdisk(option)(parameter)

Function: Observe the usage of hard disks and partition hard disks.

Parameters:

  • -b< Partition size > : specifies the size of each partition
  • -l: lists the partition table status of the specified peripheral devices
  • -s< partition number > : Prints the specified partition size to the standard output in blocks
  • -u: With the “-l” parameter list, the number of partitions replaces the number of cylinders to indicate the starting address of each partition
  • -v: displays the version information

4.4 PVS

Syntax: PVS (options)(arguments)

Run the following command to output a formatted physical volume information report.

Parameters:

  • A heading starts with a heading
  • –nosuffix: no unit of output space size

4.5 the mount

Syntax: mount(option)(parameter)

Run the following command to load a file system to a specified load point:.

Parameters:

  • -v: displays the program version
  • -l: displays the list of loaded file systems
  • -h: displays help information and exits
  • -v: verbose mode, which outputs detailed information about the execution of an instruction
  • -n: loads the file system that is not written to the /etc/mtab file
  • -r: loads the file system to read-only mode
  • -a: loads all the file systems described in /etc/fstab

4.6 MKFS

Syntax: MKFS (options)(arguments)

Function: Used to create a Linux file system on a device (usually a hard disk).

Parameters:

  • Fs: specifies the parameters for creating the file system
  • -t< File system type > : specifies the file system to be created
  • -v: displays the version information and detailed usage methods
  • -v: displays the brief usage method
  • -c: checks whether the partition is faulty before creating the file system

4.7 umount

Syntax: umount(option)(argument)

Run the following command to uninstall a loaded file system.

Parameters:

  • -a: removes all file systems recorded in /etc/mtab
  • -h: displays help
  • -n: do not save information in the /etc/mtab file
  • -r: If the file system cannot be removed successfully, try to mount the file system again in read-only mode
  • -t< File system type > : Disposes only the file system specified in the option
  • -v: displays detailed information during execution
  • -v: displays the version information

4.8 FSCK

Syntax: FSCK (option)(parameter)

Function: To check for and attempt to fix errors in a file system.

Parameters:

  • -a: automatically restores the file system without asking any questions
  • -a: Check all file systems listed in the /etc/fstab configuration file based on the contents of the file
  • -n: indicates that no command is executed and only the actions that will be performed during actual execution are listed
  • -p: When used with “-a”, all file systems are checked simultaneously
  • -r: An interactive mode in which the problem is asked while the fix is being performed, allowing the user to confirm and decide what to do
  • -r: When used with “-a”, the file system of the/directory is skipped and will not be checked
  • -s: The check jobs are executed sequentially, not simultaneously
  • -t< File system type > : specifies the type of the file system to be checked
  • -t: when the FSCK command is executed, the title information is not displayed
  • -v: displays the command execution process

4.9 the sync

Syntax: sync(option)

Function: Force the changed content to be written to the disk immediately, and update the superblock information.

Parameters:

  • –help: displays help
  • –version: Displays the version information

4.10 swapon

Syntax: swapon(option)(parameter)

Function: This function is used to activate the swap space in the Linux system. The swap space must be used for memory management in the Linux system to establish virtual memory.

Parameters:

  • -a: Start all the devices configured as swap in the /etc/fstab file as the swap area
  • -h: displays help
  • -p< Priority > : specifies the priority of the switch area
  • -s: displays the status of the switch area
  • -v: displays the version information.

In this paper, to the end.

Recommended reading

  • How do I mount an LVM disk online?
  • Linux Process Management Supervisor, YYds!
  • How to efficiently run Linux commands in the background?

This article has been become a PDF file, access links: pan.baidu.com/s/1cgDJ4Aj6… Extract code: 9FXQ


Original is not easy, if you think this article is a little useful to you, please give me a like, comment or forward for this article, because this will be my power to output more quality articles, thanks!

By the way, dig friends remember to give me a free attention yo! In case you get lost and you can’t find me next time.

See you next time!