怎么把这烦人的地址去掉?

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
枫林
帖子: 45
注册时间: 2006-10-22 16:37

怎么把这烦人的地址去掉?

#1

帖子 枫林 » 2007-07-12 15:33

这地址也太长了点,每次都要占用我好多空间。。
每次就算F11把terminal全屏了它还要将近占用一行的空间
看得好烦...


应该可以像redhat那样显示吧?

代码: 全选

[jerry@arch-at91sam9261]$....
哪位试过?
附件
就这个玩意儿了,又臭又长,太伤感情了
就这个玩意儿了,又臭又长,太伤感情了
头像
BigSnake.NET
帖子: 12522
注册时间: 2006-07-02 11:16
来自: 廣州
联系:

#2

帖子 BigSnake.NET » 2007-07-12 15:35

google搜索
bash PS1
^_^ ~~~
要理解递归,首先要理解递归。

地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
枫林
帖子: 45
注册时间: 2006-10-22 16:37

#3

帖子 枫林 » 2007-07-12 15:36

代码: 全选

[jerry@arch-at91sam9261]$.... 
对上面做个解释

代码: 全选

[用户名@当前文件夹名字]$输入命令的地方
头像
BigSnake.NET
帖子: 12522
注册时间: 2006-07-02 11:16
来自: 廣州
联系:

#4

帖子 BigSnake.NET » 2007-07-12 15:40

^_^ ~~~
要理解递归,首先要理解递归。

地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
枫林
帖子: 45
注册时间: 2006-10-22 16:37

#5

帖子 枫林 » 2007-07-12 15:47

BigSnake.NET 写了:google搜索
bash PS1
DONE!THANKS!


Reference:

http://www.linuxselfhelp.com/howtos/Bas ... .html#toc2

2.5 Bash Prompt Escape Sequences

There are a lot of escape sequences offered by the Bash shell for insertion in the prompt. From the Bash 2.02 man page:

When executing interactively, bash displays the primary
prompt PS1 when it is ready to read a command, and the
secondary prompt PS2 when it needs more input to complete
a command. Bash allows these prompt strings to be cus-
tomized by inserting a number of backslash-escaped special
characters that are decoded as follows:
\a an ASCII bell character (07)
\d the date in "Weekday Month Date" format
(e.g., "Tue May 26")
\e an ASCII escape character (033)
\h the hostname up to the first `.'
\H the hostname
\n newline
\r carriage return
\s the name of the shell, the basename of $0
(the portion following the final slash)
\t the current time in 24-hour HH:MM:SS format
\T the current time in 12-hour HH:MM:SS format
\@ the current time in 12-hour am/pm format
\u the username of the current user
\v the version of bash (e.g., 2.00)
\V the release of bash, version + patchlevel
(e.g., 2.00.0)
\w the current working directory
\W the basename of the current working direc-
tory
\! the history number of this command
\# the command number of this command
\$ if the effective UID is 0, a #, otherwise a
$
\nnn the character corresponding to the octal
number nnn
\\ a backslash
\[ begin a sequence of non-printing characters,
which could be used to embed a terminal con-
trol sequence into the prompt
\] end a sequence of non-printing characters

Continuing where we left off:

[giles@nikola giles]$ PS1="\u@\h \W> "
giles@nikola giles> ls
bin mail
giles@nikola giles>

This is similar to the default on most Linux distributions. I wanted a slightly different appearance, so I changed this to:

giles@nikola giles> PS1="[\t][\u@\h:\w]\$ "
[21:52:01][giles@nikola:~]$ ls
bin mail
[21:52:15][giles@nikola:~]$

上次由 枫林 在 2007-07-12 15:49,总共编辑 1 次。
头像
Nile
帖子: 990
注册时间: 2006-07-15 11:20
来自: 枫叶刀市

#6

帖子 Nile » 2007-07-12 15:47

换一下fish试试。
Thinkpad T400
BreezeChan
帖子: 22
注册时间: 2006-06-02 18:01

#7

帖子 BreezeChan » 2007-07-12 16:09

改PS1可以设置为只显示Basename,但怎样设置才能在path超过指定长度后以 ..... + basename的方式显示,而没有超过指定长度时,可以以full path 显示?
枫林
帖子: 45
注册时间: 2006-10-22 16:37

#8

帖子 枫林 » 2007-07-12 16:34

楼上的,
我对美观之类的要求不高
只要这个东西不占用我的地方就行

3D桌面用了一天就让我关了...
我老切换窗口,看了眼花
呵呵。。。。
头像
ericzb
帖子: 441
注册时间: 2006-11-16 21:34
来自: Bridge View
联系:

#9

帖子 ericzb » 2007-07-14 2:15

干脆把\w杀掉
然后回归到pwd
回复