-
Notifications
You must be signed in to change notification settings - Fork 280
Alias
An alias allows you to make new shortcuts and synonyms for commonly used commands.
For example, if you usually try to ping google.com in order to check your internet connection speed, it is really bothering to type every single time this command:
ping -c 10 google.com
To avoid this you can set up the alias pg that will tell t-ui to launch the above long command for you.
pg=ping -c 10 google.com
Now, anytime you want to check your internet speed you can simply type "pg".
There are two ways:
- using the t-ui command "alias"
- editing the file alias.txt
You can use the command "alias -add" to append a new alias to your alias.txt file. It's simple and fast, and you won't need to bother looking for the file, saving, checking syntax, etc.
Be aware that this method has some limitations:
- you won't be able to create a "no named alias" (an alias which has an empty name, that will be triggered when you hit enter and the input field is empty)
- you won't be able to create an alias whose name contains one or more spaces
The syntax is the following:
alias -add aliasname alias value
For example:
alias -add news search -g news
Open the text file using:
alias -file
Then, append this line to that file:
alias name=alias value
For example:
j=call John Doe
You can also define a no-named alias by adding this line:
=alias value
This is pretty useful when you don't want to waste time for an emergency, or something similar.
For example:
=call 911
Francesco Andreuzzi, Italy, andreuzzi.francesco@gmail.com