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 |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
'''pushd''' <directory> is equivalent to cd <directory> but, in addition, <directory> is put on top of a directory pile | '''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 | '''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. | '''dirs''' allows you to see the state of the pile. | ||
Line 8: | Line 8: | ||
----------- | ----------- | ||
'''!''' | '''!''' replay a previous command using a shebang <br> | ||
$ ls -lt <br> | |||
$ ls -lt | |||
$ !ls | $ !ls | ||
''':p''' | ''':p''' to verify the parameter before replaying it <br> | ||
$ !ls:p <br> | |||
$ !ls:p | |||
ls -lt | ls -lt | ||
------------ | ------------ | ||
'''!$''' reuse the last command parameter | '''!$''' reuse the last command parameter <br> | ||
~ $ mkdir toto <br> | |||
~ $ mkdir toto | ~ $ cd !$ <br> | ||
~ $ cd !$ | |||
~/toto $ | ~/toto $ |
Latest revision as of 22:44, 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 $