2. Common Linux operation commands (1) and linux operation commands
BASH: It is the GNU Bourne Again Shell, which is the default Shell on the GNU operating system.
Bourne Shell: Shell developed by Bell lab.
Korn Shell: It is the development of the Bourne Shell and is compatible with the Bourne Shell in most aspects.
C Shell: It is SUN Shell's BSD version.
Command Format:
Command name option parameter 1 parameter 2...
Common directory operation commands:
1.Pwd: (Print Working Directory abbreviation, display the current Directory)
2.Cd: Change the Directory
-- Cd/to the root directory
-- Cd ~ Go to the/home/user directory
-- Cd/usr to the usr directory under the root directory ------------ absolute path
-- Cd test: Go to the test subdirectory under the current directory ------- relative path
3.Ls: View directory content
-- Ls-a lists all files in the directory, including hidden files.
-- Ls-l lists the details in the directory, including permissions, owner, group, size, and creation date.
4.Mkdir: Create a directory
5.Rmdir: Delete directory
Common file operation commands:
1.Touch: Create a new file
-- Touch newfile: Creates a blank file named newfile.
2.Cp: Copy an object
-- Cp <source filename> <target filename>
-- Cp newfile u01/test: copy the newfile to the u01 directory and name it test.
3.Mv: Move files
-- Mv/arch/g040_870377057.dbf u01 copy the. dbf file to the u01 folder.
-- Mm-i overwrite confirmation prompt
-- Forced mv-f coverage
-- Mv-v display file movement speed
4.Rm: Delete an object
-- Rm-r recursively deletes a directory and all its subdirectories and files.
5.Ln: Link
Wildcard:
?: Can replace a single character.
*: Can replace any character.
[Charset]: Can replace any single character in the charset set.
View files:
1.Cat: Displays the content of the entire file on the screen and merges the file.
2.More: View the content in the file. more can view the content of the file by page. It also supports direct row navigation and other functions.
-- Ls-l | more-5
Note: Press Q to exit.
3.Less: Displays large files by PAGE, similar to more
-- Less filename
4.Head: Displays the first few lines of the file. The default value is 10.
5.Tail: Displays the last few lines of the file. The default value is 10.
-- Tail-f filename monitors the tail content of the filename file (10 rows by default), for example:
-- Tail-n 20 filename: display the last 20 rows of filename.
Note: Exit by CTL + C.