
我想向我的.bashrc
文件(或相应的)添加一个命令,在这种情况下setterm --foreground red
,该命令仅在我启动虚拟终端ctrl+ alt+F1 - 6而不是 Gnome 终端等时读取。
这可能吗?
如果是这样,怎么办?
答案1
if [ "$TERM" = "linux" ]; then
# Stuff to do only if running in a virtual console
setterm --foreground red
fi
我想向我的.bashrc
文件(或相应的)添加一个命令,在这种情况下setterm --foreground red
,该命令仅在我启动虚拟终端ctrl+ alt+F1 - 6而不是 Gnome 终端等时读取。
这可能吗?
如果是这样,怎么办?
if [ "$TERM" = "linux" ]; then
# Stuff to do only if running in a virtual console
setterm --foreground red
fi