课程: Linux CentOS 7: Shells and Processes
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Shell history tricks
- [Instructor] Using the shell's history can keep you from having to type in commands over again. If you want to just bring up the last command, you may want to use your up and down arrow keys. If you want to see what commands you've typed in, use the history command, by typing in history into a shell. History shows the most recent commands we've typed, up to the shell limit. The limit is usually 500 or 1,000 items, depending on the configuration. If you want to bring back the entire last line from the history, type in !! and hit enter. In my case, it's the history command, which we just typed in. If you want to execute the command four lines from the bottom, you'll use !-4 and hit enter. Type in history again to see the list. We can see that four lines from the bottom was the clear command for me. For you, it may be something else. If you want to run a specific line, just specify the number after the ! For…