User:Tancre/Others/Usefull commands: Difference between revisions
< User:Tancre | Others
(Created page with " '''pushd''' <directory> is equivalent to cd <directory> but, in addition, <directory> is put on top of a directory pile. '''popd''' remove the last directory saved in the p...") |
No edit summary |
||
Line 10: | Line 10: | ||
'''!''' Replay a previous command using a shebang | '''!''' Replay a previous command using a shebang | ||
$ ls -lt | $ ls -lt <br> | ||
$ !ls | $ !ls | ||
''':p''' To verify the parameter before replaying it | ''':p''' To verify the parameter before replaying it | ||
$ !ls:p | $ !ls:p <br> | ||
ls -lt | ls -lt | ||
Revision as of 22:41, 23 January 2019
pushd <directory> is equivalent to cd <directory> but, in addition, <directory> is put on top of a directory pile.
popd remove the last directory saved in the pile and change directory to the directory on top of the pile.
dirs allows you to see the state of the pile.
! Replay a previous command using a shebang
$ ls -lt
$ !ls
:p To verify the parameter before replaying it
$ !ls:p
ls -lt
!$ reuse the last command parameter
~ $ mkdir toto
~ $ cd !$
~/toto $