打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
A list of the commonly used variables in Linux
System VariableMeaningTo View Variable Value Type
BASH_VERSIONHolds the version of this instance of bash.echo $BASH_VERSION
HOSTNAMEThe name of the your computer.echo $HOSTNAME
CDPATHThe search path for the cd command.echo $CDPATH
HISTFILEThe name of the file in which command history is saved.echo $HISTFILE
HISTFILESIZEThe maximum number of lines contained in the history file.echo $HISTFILESIZE
HISTSIZEThe number of commands to remember in the command history. The default value is 500.echo $HISTSIZE
HOMEThe home directory of the current user.echo $HOME
IFSThe Internal Field Separator that is used for word splitting after expansion and to split lines into words with
the read builtin command. The default value is <space><tab><newline>.
echo $IFS
LANGUsed to determine the locale category for any category not specifically selected with a variable starting with LC_.echo $LANG
PATHThe search path for commands. It is a colon-separated list of directories in which the shell looks for commands.echo $PATH
PS1Your prompt settings.echo $PS1
TMOUTThe default timeout for the read builtin command. Also in an interactive shell, the value is interpreted as
the number of seconds to wait for input after issuing the command. If not input provided it will logout user.
echo $TMOUT
TERMYour login terminal type.echo $TERM
export TERM=vt100
SHELLSet path to login shell.echo $SHELL
DISPLAYSet X display nameecho $DISPLAY
export DISPLAY=:0.1
EDITORSet name of default text editor.export EDITOR=/usr/bin/vim

set and env command

You can use the env / set command too:

 envenv | moresetset | more 

Sample outputs:

HOME=/home/vivekvivek@nas01:~$ envTERM=xterm-256colorSHELL=/bin/bashXDG_SESSION_COOKIE=9ee90112ba2cb349f07bfe2f00002e46-1381581541.324726-906214463SSH_CLIENT=192.168.1.6 60190 22SSH_TTY=/dev/pts/1USER=vivekMAIL=/var/mail/vivekPATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/gamesPWD=/home/vivekLANG=en_INSHLVL=1HOME=/home/vivekLANGUAGE=en_IN:enLOGNAME=vivekSSH_CONNECTION=192.168.1.6 60190 192.168.1.10 22_=/usr/bin/env

A note about env/set command

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
Loops in Bash
linux shell 学习笔记(四)
云计算学习路线教程大纲课件:Linux新手入门教程
Bash by example, Part 1
Linux Bash编程超详细语法总结
linux超级基础系列——shell变量(本地变量和环境变量)
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服