Please follow the Linux basic commands as required on the machine.
CD command: Switch directories
(1) Switch to directory/usr/local
Cd/usr/local
(2) Go to the current upper directory
Cd..
(3) Go back to your home folder
Cd
ls command: View files and directories
(4) View directory/usr for all files
Ls/usr
mkdir command: Create new directory
(5) Enter the/tmp directory, create a directory named A, and see how many directories exist
Cd/tmp
mkdir A
Ls/tmp
(6) Create directory A1/a2/a3/a4
mkdir A1
Cd/a1
Mkdi A2
Cd/a2
MKDI A3
CD VA3
Mkdi A4
rmdir command: Delete empty directory
(7) Delete the directory A (/tmp) created in the example above
Cd/tmp
RmDir A
(8) Delete directory a1/a2/a3/a4 to see how many directories exist
Cd/a1
Cd/a2
Cd/a3
Cd/a4
RmDir A4
Cd/a3
RMDIR A3
Cd/a2
RmDir A2
Cd/a1
RMDIR A1
Ls
CP command: Copy files or directories
(9) Copy the. BASHRC under the home folder to/usr, named Bashrc1
Cd
Cp~/.bashrc/usr/bashrc1
(10) Create a new directory test in/tmp and copy the contents of this directory to/usr
Cd/tmp
mkdir test
sudo cp~/tmp/test/usr
MV Command: Move files and directories, or rename
(11) Move the example file Bashrc1 to the directory/usr/test
MV Bashrcl1/usr/test
(12) Rename the above example test directory to Test2
MV Test Test2
RM command: Removing files or directories
(13) Delete the Bashrc1 file copied from the previous example
RM ~ I BASHRCL
(14) Delete the Test2 directory of the above example
Rm:remove Regular File Test2
Cat command: View file contents
(15) View the contents of the. bashrc file under the home folder
Ccat/.BASHRC
TAC Command: Reverse list
(16) Reverse View the contents of the. bashrc file in the home folder
TAC/.BASHRC
More command: One page, one page turn to view
(17) Turn the page to view the contents of the. bashrc file in the home folder
More/.BASHRC
Head command: Remove the previous lines
(18) View the first 20 lines of the contents of the. bashrc file in the home folder
Head–n/.BASHRC
(19) View the contents of the. bashrc file in the home folder, followed by 50 lines, showing only the previous lines
Head–n/.BASHRC
Tail command: Take back a few lines
(20) View the contents of the. bashrc file in the home folder the last 20 lines
Tail–n/.BASHRC
(21) View the contents of the. bashrc file in the home folder, listing only 50 rows of data
Tail–n/.BASHRC
Touch command: Modify the file time or create a new file
(22) Create an empty file in/tmp Hello and check the time
Touch/tmp/hello
(23) Modify the Hello file to adjust the date to 5 days ago
Touch–d "5 days Ago" Hello
Chown command: Modify file Owner permissions
(24) Change the owner of the hello file to the root account and view the properties
Chown–r/tmp/hello
Find command: File lookup
(25) Find the file named. BASHRC in the home folder
find/-name. BASHRC
Tar command: Compress command
(26) Create a new folder in/directory test and then package it in/directory into test.tar.gz
Mkdir/test
TAR–RF test.tar.gz
(27) Unzip to/tmp directory
TAR–XZVF test.tar.gz/tmp
grep command: Find string
(28) Find the string ' examples ' from the ~/.BASHRC file
Grep–rn ' examples '
(29) Configure Java environment variables, set in ~/.BASHRC
grep/.bashrc/jdk
(30) View the value of the Java_home variable
Grep/java-home
Familiar with common Linux operations