Setting Temporary Environment Variables in Kali Linux

Here is a useful tip I learned today while working on a network services module for Tryhackme. I was getting fed up with typing the IP address of a host I was learning on. Adding the IP address to every Nmap, SSH and Telnet command was getting somewhat tiresome. I then discovered the “Export” command it seems typing:

Export ip=10.10.10.32

Allows me to store 10.10.10.32 as a system variable.

Once stored I could then run the following command calling the variable with a leading $ symbol:

Nmap $ip
SSH user@$ip

I hope this has been useful for you.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *