Quantcast
Channel: Environment Variable for Username - Ask Ubuntu
Viewing all articles
Browse latest Browse all 5

Answer by Rinzwind for Environment Variable for Username

$
0
0
$USER

will change it into your username.

Example

rinzwind@schijfwereld:~$ echo $USERrinzwind

There are more...

~$ cd /tmp:/tmp$ echo $HOME/home/rinzwind:/tmp$ echo $PWD/tmp$ echo $HOSTNAMEschijfwereld

To list the current values of all environment variables:

env

Keep in mind that variable names are case-sensitive


To expand on this. You can create your own too:

export var=value

will create $var with value.

$ export var=1111rinzwind@schijfwereld:~$ echo $var1111

Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>