reuse terminal commands and parameters of commands
#1
In linux terminal you don't have to type each command and its parameters letter by letter.



ctrl+r

When you want to reuse the command that you used before you can press ctrl+r and type the part of that command. For example a few days ago you put

Code:
ssh 123.45.67.89


Now you can just press ctrl+r and type

Quote:.8

The whole command should appear. If not press ctrl+r repeatedly.




Esc and . (Esc and dot)

You can also reuse the parameter part of the last command by pressing Esc and dot. (Not simultaneously)



Both tricks are very useful.
#2
We can repeat the commands by pressing the up-arrow, how is this different than up-arrow?
Spoiler: show
Thanks Host4Fun for VPS 4, Hostigation for VPS 18, and FreeVPS for being an awesome community!
Thanks NoUptime (@NoUptime) for the VPS!



#3
I second @Jayce 's question.

I find the up arrow more convenient than the ctrl+r on a computer or on mobile
[Image: img.php?userid=19870&txt=1]
Thanks to FREEVPS.us and HostUS for VPS 16
Thanks to @NoUptime for the lovely VPS
#4
Up and down arrows allow you to scroll through your command history to use commands you used before again. This guide is about a reverse search function in the command history that allows to find specific commands you want to use again instead of pressing the up arrow hundreds of times.
#5
Using ctrl+r instead of up arrow may be quicker sometimes. Imagine you want to restart apache webserver. You remember that you restarted it two or three days ago. So you can use ctrl+r rest then and get it quickly.  In the case of pressing up arrow you would have to press it hundreds of times.

Of course knowing up arrow functionality is very helpful too.




Users browsing this thread: 1 Guest(s)

Switch to mobile version

Sponsors: FuzzyHosts - Ftpit - ZXPlay - GalaxyHostPlus - Verelox- HostUS - HostMada - Host4Fun - Evolution-Host - NodeBlade - HostDare


BitCoin donations: 1DQxbstaTb5SWk6QC2gFeQUTFR64JX4cEo