The shell, known as a program that acts as an interface between the user and the Linux OS, allows the user to enter commands that need to be executed to the OS. There are a lot of shells here, just bash.
0) Shell version of the experiment
Show Shell version:
/bin/bash--version
Results:
1) file. bash_history
This file saves the history command, which is usually saved when the user exits the shell normally, in the directory: "~/.bash_history".
Command Display ~ directory, all files with. Start:
ls grep " .* "
Results:
①!!, two exclamation mark means "execute last command";
②!n, which indicates the execution of the nth command in the history command;
③!string, which represents the first command in the execution History command that starts with string;
2) redirect
Redirects include: redirected output and redirected output.
① REDIRECT Output
redirect the display to the Test.txt file:
ls -l > Test.txt
Using VIM to open the file, the results are as follows:
Append the results of the PS command to the Test.txt file:
PS >> test.txt
Results:
② REDIRECT Input
Redirect the contents of the Test.txt file to the more command:
More < Test.txt
Results:
Linux Shell Learning Notes (i)