Create an alias for a command
Solved
ramsesthebest
Posted messages
81
Registration date
Status
Member
Last intervention
-
waouh -
waouh -
Hello community,
I want to create a shortcut or alias for a command. Specifically, I want the command "telnet localhost 2500" to execute when I type "t".
Thank you in advance for your responses.
I want to create a shortcut or alias for a command. Specifically, I want the command "telnet localhost 2500" to execute when I type "t".
Thank you in advance for your responses.
9 answers
Hello,
Just type in a terminal:
;-))
--
Z'@+...che.
Just type in a terminal:
alias t='telnet localhost 2500'and to make it permanent, add this line to your ".bashrc".
;-))
--
Z'@+...che.
JP : Zen, my Nuggets ! ;-) Knowledge is only good if shared.
In your "/home/toi".
Type:
You can also use "locate .bashrc" to locate it...
;-))
--
Z'@+...che.
Type:
ls -a ~and you should see it.
You can also use "locate .bashrc" to locate it...
;-))
--
Z'@+...che.
JP : Zen, my Nuggets ! ;-) Knowledge is only good if it is shared.
Thank you for worrying about me, I'm actually on FC5.
There must have been an issue on my end because everything is working perfectly now.
Thanks again to everyone and long live CCM.
There must have been an issue on my end because everything is working perfectly now.
Thanks again to everyone and long live CCM.
Apparently, I jumped the gun a bit :(
I typed the alias in the command line and it’s okay.
I then added it to the .bashrc file
but when I restart the machine and type t, I get this message:
~]# t
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host: Connection refused
I don’t understand.
I typed the alias in the command line and it’s okay.
I then added it to the .bashrc file
but when I restart the machine and type t, I get this message:
~]# t
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host: Connection refused
I don’t understand.
Le fichier .bashrc se trouve généralement dans le répertoire personnel de l'utilisateur. Pour le trouver, vous pouvez ouvrir un terminal et utiliser la commande suivante :
```
nano ~/.bashrc
```
ou
```
vi ~/.bashrc
```
Cela ouvrira le fichier .bashrc si celui-ci existe.
```
nano ~/.bashrc
```
ou
```
vi ~/.bashrc
```
Cela ouvrira le fichier .bashrc si celui-ci existe.
Heu... which distribution are you on?
During the first attempts in the command line, were you also logged in as "root"?
Because depending on the daemon that handles "telnet" (inet.d or xinet.d) and their respective configuration files, it might be that telnet on localhost is forbidden... ;-\
So check that...
--
Z'@+...che.
During the first attempts in the command line, were you also logged in as "root"?
Because depending on the daemon that handles "telnet" (inet.d or xinet.d) and their respective configuration files, it might be that telnet on localhost is forbidden... ;-\
So check that...
--
Z'@+...che.
JP : Zen, my Nuggets ! ;-) Knowledge is only good when shared.
Okay thanks, I found it and added the line in the file.
It's really nice of you.
Thanks again for everything.
It's really nice of you.
Thanks again for everything.