What are the skills of using history commands in linux
This article mainly introduces the skills of using history commands in linux. It is very detailed and has a certain reference value. Friends who are interested must finish reading it.
Techniques for using historical commands
Sharing tips for using several historical commands can improve your productivity.
!!: repeat the previous command;! n: repeat the N command in the history history, N can be viewed through history;! pw: repeat the most recent history command, starting with pw, which is very useful, and the editor uses it very frequently;! $: represents the last argument of the last command
Guess that most students have not used it! $, here is a simple example to let you feel its efficient use.
$vim / root/sniffer/src/main.c
Mv! $! $.bak
# equivalent to
$mv / root/sniffer/src/main.c / root/sniffer/src/main.c.bak
The current working directory is root. I want to change main.c to main.c.bak. Normally you may need to type the long parameter containing main.c twice, of course, you may choose to copy and paste directly.
And I can easily and elegantly change my name by using the! $variable, isn't it very hacker?
These are all the contents of this article entitled "what are the skills for using historical commands in linux?" Thank you for your reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!