Common commands for Linux O & M: du and Common commands for linux: du
The commonly used du-sh * Linux du command is also used to view the space, but unlike the df command, the Linux du command is used to view the space used by files and directory disks, there are some differences with df commands.
1. Command Format:
Du [Option] [file]
2. command functions:
Displays the disk space used by each file and directory.
3. command parameters:
-A or-all indicates the size of individual files in the directory.
-B or-bytes: displays the size of directories or files in bytes.
-C or -- total not only displays the size of individual directories or files, but also the total number of all directories or files.
-K or -- kilobytes is output in KB (1024 bytes.
-M or -- megabytes is output in MB.
-S or -- summarize only displays the total, and only lists the last added total value.
-H or -- human-readable is in the unit of K, M, and G to improve information readability.
-X or -- one-file-xystem is based on the file system at the beginning of processing. If it encounters a different file system directory, it is skipped.
-L <symbolic link> or -- dereference <symbolic link> shows the source file size of the specified symbolic link in the option.
-S or -- separate-dirs displays the size of individual directories in hours without the size of their subdirectories.
-X <File> or -- exclude-from = <File> specifies the directory or file in <File>.
-- Exclude = <directory or File> skips the specified directory or file.
-D or -- dereference-args displays the source file size of the specified symbolic link.
-H or -- si is the same as-h, but K, M, and G are measured in 1000 units.
-L or -- count-links repeat the hardware link file.
View cat/etc/RedHat-release
Cat/proc/version
Uname-
Cat/etc/issue: Check the centos version.
Getconf LONG_BIT: 32 or 64-bit
File/bin/ls: 32 or 64-bit
Install redhat-lsb for lsb_release centos
Upload and download the rz and sz installation methods
1. Installation Method (recommended)
Yum install lrzsz-y
2. Select the "DialupNetworking Support" group package when installing Linux.
3. Install the group package directly after the system is connected to IOT platform.
Yum groupinstall "Dialup Networking Support"-y
Upload and download files
1. condition: Use SecureCRT or Xshell or other client tools to connect to Linux
2. upload and download command Test
1) Upload (rz)
Run the rz command in the SSH command line of the client. The command is as follows:
[Root @ oldboy ~] # Rz
After execution, the selection window for uploading files is displayed. You can select a file to upload (direct directory upload is not supported ).
Tip: You can use rz-y to overwrite the upload. The default directory of the upload window can be set in the SSH client.
2) download (sz)
For download, you can directly use szfilename, where filename is the name of the file you want to download. If it is a directory, You need to package it into a single file for download. By default, the download directory is downloaded to the Home Directory of the operating system.
[Root @ oldboy ~] # Sz oldboy.txt # <= oldboy.txt must exist. It can be a relative or absolute path.
The upload/download directory of SecureCRT is the upload/download directory under the installation directory by default, which can be modified by yourself. XShell is set in file --> Property --> file transmission. It is called before download by default.