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.. C
(3) Go back to your home folder
Cd
ls command: View files and directories
(4) View directory/usr for all files
Ls-al/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-a
(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/tmp
RmDir A/
(8) Delete directory a1/a2/a3/a4 to see how many directories exist
Rmdir-p A1/A2/A3/A4
Ls-d
CP command: Copy files or directories
(9) Copy the. BASHRC under the home folder to/usr, named Bashrc1
Cd
sudo cp ~/.bashrc/usr/bashrc1
(10) Create a new directory test in/tmp and copy the contents of this directory to/usr
Cd/tmp
mkdir text
sudo cp-r test//usr
MV Command: Move files and directories, or rename
(11) Move the example file Bashrc1 to the directory/usr/test
sudo mv Bashrc1/usr/test
(12) Rename the above example test directory to Test2
sudo mv Test test2
RM command: Removing files or directories
(13) Delete the Bashrc1 file copied from the previous example
sudo rm-r bashrc1
(14) Delete the Test2 directory of the above example
sudo rm-r test2
Cat command: View file contents
(15) View the contents of the. bashrc file under the home folder
Cat ~/.BASHRCC
TAC Command: Reverse list
(16) Reverse View the contents of the. bashrc file in the home folder
TAC ~/.BASHRCC
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-50 ~/.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/tmp/hello.txt
(23) Modify the Hello file to adjust the date to 5 days ago
Touch-d 5/tmp/hello.txt
Chown command: Modify file Owner permissions
(24) Change the owner of the hello file to the root account and view the properties
Chown Root/tmp/hello.txt
Find command: File lookup
(25) Find the file named. BASHRC in the home folder
Find ~/.BASHRC
Tar command: Compress command
(26) Create a new folder in/directory test and then package it in/directory into test.tar.gz
cd/
mkdir test
Tar czvf test.tar.gz
(27) Unzip to/tmp directory
MV Test. tar.gz/tmp
TAR-ZXVF test.tar.gz
grep command: Find string
(28) Find the string ' examples ' from the ~/.BASHRC file
grep ' examples ' ~/.BASHRC
(29) Configure Java environment variables, set in ~/.BASHRC
Gedit ~/.BASHRC
Echo $JAVA _home/usr/lib/jvm/default-java
(30) View the value of the Java_home variable
Echo $JAVA _home
Familiar with common Linux operations