Many are consistent with regular expression re; 1. Modify last executed command
Remove redundant parts;
% grep fooo/var/log/auth.log
% ^o
% grep foo/var/log/auth.log
Replacement (Error or loss):
# Replace
% cat myflie
% ^li^il%
cat myfile
# missing% ansible vod-m command-a '
uptim '
% ^im^ime
% Ansible vod-m command-a ' uptime '
Advanced Replacement:
% ansible nginx-m command-a ' which nginx '
%!:gs/nginx/squid
% ansible squid-m ' command-a squid '
% ^nginx^squid^:g # zsh
2. Use command line to enter history
Query history
$ echo $HISTSIZE
$ echo $HISTFILE
$ history
$ history | Less
$ history 5
!$: Last parameter of previous command
$ mkdir Videos
$ cd!$
!^: first parameter of previous command
$ ls/usr/share/doc/usr/share/man
$ cd!^
: t: Intercept the end of the path
$ wget http://nginx.org/download/nginx-1.4.7.tar.gz
$ tar-zxvf!$:t
tar-zxvf nginx-1.4.7.tar.gz
# is equivalent to taking BaseName
: r: Intercepting filename
$ unzip Filename.zip
$ cd!$:r
CD filename
: E: File Development name
ReferencesUse Linux command line to efficiently use Linux command line like hackers