如何在Unix中改变shell提示符? [英] How to change shell prompt in Unix?

查看:167
本文介绍了如何在Unix中改变shell提示符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想禁用Unix shell提示字符( $ ),通常我们在终端看到。有没有任何命令或设置可以做到这一点?我使用的是Solaris操作系统。



通过shell提示符我的意思是:

 > $ 
>#


解决方案

你可以得到花哨并把主机名放在那里。但基本上你改变PS1环境变量:

  export PS1 = hello 
pre>

您可以在〜/ .bashrc文件中添加此命令。或其他启动文件,如果你使用另一个shell。


I want to disable the Unix shell prompt character ($, #, %) which usually we see in terminal. Is there any command or setting which can do this? I am using Solaris OS.

By shell prompt character I mean:

>$
>#

解决方案

You can get fancy and put the host name in there. But basically you change the PS1 environment variable:

export PS1=hello

You can add this command in your ~/.bashrc file. Or other startup file, if you use another shell.

这篇关于如何在Unix中改变shell提示符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆