1: User's shell History command saved in Home/username/.bash_history
#!! execute the user's previous command#! PWexecutes the last command in the command history that begins with PW2: ' * ' to match 0 or more characters'? ' Match one character#ls-D day* lists the directories that start with day and match all characters later#ls-D day? Lists the directory at the start of day, followed by a character3:>> Append redirect in file> Redirect in Files4:| Pipe character#cat/etc/passwd|wc-lthe output of the CAT/ETC/PASSWD directive is used as input to the WC command. The number of rows that count passwd5 Ctrl + Z command to pause a task#jobs can view the paused tasks as follows:(my-env) [[email protected] linux_learn]$ jobs[1]+ Stopped vim Test1.txt#fg +id can resume operation#bg +id can put this task in the background run#ps aux |grep test1 can view the PID of the running process in the background#kill-9 PID can end this process6 $PATHPath When you enter a command, Linux looks for the path that is recorded in path. For example, in the root directory/below you can enter the command LS,you can also enter LS in the/usr directory,but in fact ls This command is not at all in this two directory. in fact, when you enter the command, Linux will go to the/bin,/usr/bin,/sbin and other directories to find the command you entered at this time,and the value of path is exactly the/bin:/sbin:/usr/bin:the colon separates the directory from the directory. 7 SET command can display the system preset variables such as path home, you can also display the user's own defined variables#myname =aming Setting custom variables#set |grep mynamemyname=amingYou can view the variables that you define#bash into another shell.#set |grep myname cannot see the variables we define, the defined variables exist only in the defined shell .7.1 allow defined variables to be used by all users#sudo Vim/etc/profileAdd Export myname=aming#source/etc/profile Effective7.2 Let the defined variables take effect in all child shells#abc =123#export ABC7.3 Canceling a variable unset#unset ABC#unset myname8 WC Command# wc/etc/passwd-l Count rows# wc/etc/passwd-m Count characters# wc/etc/passwd-w Number of statistical words9 ~ Indicates the user's home directoryRoot under the/rootNormal user under/home/username2> indicates error redirection2>> indicates error append redirect#ls aaaa 2>/tmp/error#ls aaaa 2>>/tmp/errorYou can view errors in error
Linux Learning essay-shell basic knowledge