Is it possible to create an alias wherein it will use a keystroke.
Like to clear the screen in bash i have to use CTRL + l.
I want to make an alias 'c' out of this.
Thanks.
Is it possible to create an alias wherein it will use a keystroke.
Like to clear the screen in bash i have to use CTRL + l.
I want to make an alias 'c' out of this.
Thanks.
CTRL + i gives one a tab character so aliasing it would affect tab as well and vice versa.
Actually its not "CTRL + i" .... it is "CTRL + l" ...... lowercase L
AFAIK you can't alias an keystroke, but you can create an alias for the clear program, eg alais c=`which clear`
just curious, why would we need the "which" command?
if "clear" is in our path, then wouldn't this work:
alias c='clear'
if "clear" is not in our path, then it is not going to work either way.
Am i missing something? I'm not trying to be a smart@$$, just trying to learn something here.
Sure, it would still work the same. Just a habit of mine to reference programs by their full path.
The main reason to reference the program by it full path, is that many people create aliases for utilities like (i.e l='ls -F' or rm='rm -i' or grep='grep -i') To avoid having a command not work as expected you reference it by it full path. I agree that it is a good habit to get into when working on machines that are accessed by many people.