ls: Listing directory contents
Example: [Email protected]:~$ ls
Touch: Used to create a new blank file and refresh the modified date if the file already exists.
[Email protected]:~/demo$ ls
[Email protected]:~/demo$ Touch Demo.txt
[Email protected]:~/demo$ ls
Demo.txt
File: View files Type
~$ file Killouterr.txt
Cat: View text file contents
$ cat Killouterr.txt
CP: Copying Files or directories
Common parameters:
-R: Recursively replicate entire directory tree
-V: Displays details of the replication process
RM: Deleting files or directories
Common parameters:
-I: Interactive
-r: Recursively delete directories and created files
-F: Force delete
mkdir: Create a directory
$ mkdir Demo
RmDir: Delete an empty directory (the contents of the folder can actually be deleted, but generally not recommended)
$ rmdir Demo
Output, view command:
Echo: Displays the content entered at the command line
Cat: Display file contents
Head:-n Display head n rows
Tail:-n display tail n rows,-F continuous Display file update content
MORE: Page turn display file content, can only page down
View hardware Information
Administrator rights required to view hardware information
LSPCI: Viewing PCI devices
-V: View more information
LSUSB: Viewing USB devices
-V: View more information
Lsmod: Viewing the loaded module
Less: page turn display file content, can page up and down
MV: Moving or renaming files or directories
When the operation in the current directory is extremely renamed: $ mv Killout.txt kill.txt
When the cross-catalog operation is for Mobile: $ mv Hello./code/hello (can also be renamed while moving)
Date: View or set the current system time
+%: for setting specific formats
$ date +%y--%m--%d
2015--05--14
Cal: Show Calendar
Uptime: Check the system run time
View hardware Information
Administrator rights required to view hardware information
LSPCI: Viewing PCI devices
-V: View more information
LSUSB: Viewing USB devices
-V: View more information
Lsmod: Viewing the loaded module
Shutdown, restart (requires root access)
Shutdown: Shutting down or restarting your computer
-H: Turn off the computer
-R: Restart the computer
Poweroff: Turn off the computer now
Reboot: Restart your computer now
Archive, Compress
Zip: Compressed file
Syntax: Zip compressed file name compressed after file name
$ zip-r myzip.zip./* Package All files under the current directory (-R recursively compress files in subdirectories)
$ zip zip.zip. /kill.txt (This way the compressed file is below the current directory) is not recommended
Unzip: Extracting files
Syntax: Unzip compressed file name
$ unzip Zip.zip (the compressed package is compressed in the previous level of the file but the decompression will be ignored, extracted in the current directory)
Gzip: Compress files
Tar: Archive file
TAR–CVF archived file name after archive
C:create;v:verbose;f:file
TAR-CVF Aa.tar PPT
TAR–XVF Release Tar package (also known as unpack)
X:extract;v:verbose;f:file
$ TAR-XVF Aa.tar
TAR–CVZF (archive and Compress) file names archived after archive
$ TAR-CVZF Aa1 PPT
Note: Tar itself is only packaged, not compressed. Only a few options are added
After, such as: Z, J, etc., only on the basis of packaging compression.
Get help
-H or-help parameter
Man command
Info command
Doc Document:/usr/share/doc
/********************************
*shell
********************************/
Type
The type command allows you to view the types of commands
Echo
Display the value of a variable
~$ Echo $name
Define variables: (variable name = variable value)
~$ Name=zizi
unset
Cancel a variable
unset name
Env
View environment variables
Set
View all variables: including environment variables and custom variables
The main difference between environment variables and custom variables is scope differences.
Environment variables are valid throughout the bash run, and custom variables are only in the current process
are valid.
Use the Export command to convert a custom variable to an environment variable.
Export name;
Use env to see name
Read
Reading variable values from the keyboard, and user interaction, is often used in shell script.
Important Parameters:
-P: Follow-up prompt statement;
-T: Number of seconds to wait after
# read-p "Please input:"-T test[parameter name]
Linux instruction Learning (continuous update)