I recently made the insanely long overdue switch from tcsh to bash. The only thing I miss is tcsh's ESC+p feature: Start typing a command and then hit ESC+p (I actually found the equivalent ctrl-[p easier to type) and it jumps to the most recent command in your history that starts with what you've typed so far.
Perhaps the best answer is to just get used to bash's Ctrl+r but so far I don't like it as much. I often start typing a command and then it occurs to me that I've issued it before. With tcsh's feature I could then do ESC+p+Enter to re-issue it. It's so quick that I'd usually never use up-arrow for anything more than 2 commands ago.
An example of where I found it especially nice: Long commands often start with a dot, because they're of the form
./myprogram.pl -lots -of -args -and -switches
In tcsh I would issue a command like that, then maybe ls, less, tail, whatever, and then to reissue the long command, 4 keys: dot, escape, p, enter.
How can I do that in Bash? Or, to make it concrete, what's the fewest number of keystrokes in bash to say "repeat the last command that started with a dot"? Can it match or beat tcsh's 4?
Ctrl+A or Home: Go to the beginning of the line. Ctrl+E or End: Go to the end of the line.
After you have typed what you are looking for, use the CTRL-R key combination to scroll backward through the history. Use CTRL-R repeatedly to find every reference to the string you've entered. Once you've found the command you're looking for, use [Enter] to execute it.
echo command in linux is used to display line of text/string that are passed as an argument . This is a built in command that is mostly used in shell scripts and batch files to output status text to the screen or a file.
ctrl+z stops the process and returns you to the current shell. You can now type fg to continue process, or type bg to continue the process in the background.
I was in the same boat as you, needing to switch to bash from tcsh.
I just created a new ~/.inputrc file as follows and everything works great!
$ cat ~/.inputrc "\ep": history-search-backward "\en": history-search-forward
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With