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 commands: Viewing files and directories
(4) View directory/usr for all files
Cd/usr
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-p A1/A2/A3/A4
rmdir command: Delete empty directory
(7) Delete the directory A (/tmp) created in the example above
cd~
RmDir A
(8) Delete directory a1/a2/a3/a4 to see how many directories exist
Rmdir-p A1/A2/A3/A4
CP command: Copy a file or directory
(9) Copy the. BASHRC under the home folder to/usr, named Bashrc1
sudo cp-i ~/.bashrc/usr/bashrc1
(10) Create a new directory test in/tmp and copy the contents of this directory to/usr
Cd/tmp
mkdir test
Cp-i ~/TEST/USR
MV commands: Moving files and directories, or renaming
(11) Move the example file Bashrc1 to the directory/usr/test
CD ~/USR Bashrc1
MV Bachrc1 Usr/test
(12) Rename the above example test directory to Test2
MV Test Test2
RM commands: Removing files or directories
(13) Delete the Bashrc1 file copied from the previous example
Rm-i Bashrc1
(14) Delete the Test2 directory of the above example
Rm-i test2
Cat command: View file contents
(15) View the contents of the. bashrc file under the home folder
Cat/.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 flip 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 20/.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 +50 ~/.BASHRC
Touch command: Modify the file time or create a new file
(22) Create an empty file in/tmp Hello and check the time
Cd/tmp
Touch Hello
Ls-l 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
sudo chown Root/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
CD ~
sudo mkdir test
sudo tar-zcv-f/test.tar.gz test
(27) Unzip to/tmp directory
sudo tar-zcv-f/test.tar.gz-c/tmp
grep command: Find string
(28) Find the string ' examples ' from the ~/.BASHRC file
Grep-n ' examples ' ~/.BASHRC
(29) Configure Java environment variables, set in ~/.BASHRC
Open the file with the Nano command first
Nano ~/.BASHRC
Then set the Java environment variable
java_home=/usr/local/java/jdk1.8.0_161
(30) View the value of the Java_home variable
Echo $JAVA _home
Familiar with common Linux operations