简体   繁体   中英

Type last executed message in linux terminal shortcut

so I'm looking for a shortcut to automatically fill out the current line with the last executed command, for example, say I executed the ls command, now my terminal would look a little something like this:

$ >> ls
example.txt important_stuff etc.
$ >> 

now I want to type ls again without typing it out manually (useful for long lines of command) so my terminal would look like this:

$ >> ls
example.txt importand_stuff etc.
$ >> ls

what is the shortcut to do this?

You can usually press (up arrow) key to bring back the last command. You can press this key multiple times to go through your shell history.

The history command will show you recently executed commands, might be useful too.

Press CTRL+P to switch to the last command, and then press CTRL+O to execute it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM