Customize your profile during login the linux
来源:互联网 发布:玩网络十三水输惨了 编辑:程序博客网 时间:2024/06/14 00:23
1. PS1
http://www.2cto.com/os/201204/126214.html
http://blog.sina.com.cn/s/blog_6433391301013phx.html
# PS1='自定义内容'
===========================
===========================
\d :代表日期,格式为weekday month date,例如:"Mon Aug 1"
\H :完整的主机名称。例如:我的机器名称为:fc4.linux,则这个名称就是fc4.linux
\h :仅取主机的第一个名字,如上例,则为fc4,.linux则被省略
\t :显示时间为24小时格式,如:HH:MM:SS
\T :显示时间为12小时格式
\A :显示时间为24小时格式:HH:MM
\u :当前用户的账号名称
\v :BASH的版本信息
\w :完整的工作目录名称。家目录会以 ~代替
\W :利用basename取得工作目录名称,所以只会列出最后一个目录
\# :下达的第几个命令
\$ :提示字符,如果是root时,提示符为:# ,普通用户则为:$
\a
\d
\D{format} the format is passed to strftime(3) and the result isinserted into the prompt string; an empty format results in alocale-specific time representation. The braces are required
\e
\h
\H
\j
\l
\n
\r
\s
\t
\T
\@
\A
\u
\v
\V
\w
\W
\!
\#
\$
\nnn
\\
\]
PS1="\u@\h:\w\$ "
PS1="\e[1;32m\u\e[m\e[1;33m@\e[m\e[1;35m\h\e[m:\w\$"
PS1="\[\e[1;32m\]\u\[\e[m\]\[\e[1;33m\]@\[\e[m\]\[\e[1;35m\]\h\[\e[m\]:\w\$ "
#user definedexport PS1='\u@\h: \w>'
So, the promote PS1 as below:
>cd workspace/sonora@sonora-Vostro-270s: ~/workspace>
2. kinds of profiles but which one works for you?
a) Login shell: bash, $HOME/.bash_profile, $HOME/.bashrc.
".bash_profile" is invoked when the user login the box.
".bashrc" is invoked when the user starts a new terminal.
b) Login shell: ksh, $HOME/.profile, $HOME/.krc
As much as the same bash shell.
- Customize your profile during login the linux
- Customize Your Own Linux
- How to customize a link at your desktop in LINUX
- Customize your JAXB bindings
- Milestone/A853/XT702/umts_sholes Compile your own Android ROM and Customize your own linux kernel
- Customize the default local user profile when preparing an image of Windows
- An internal error occurred during: "Computing size". The profile is
- Customize your own MFC message
- Customize your own Silverlight control
- Customize Your Photo ID Cards_598
- customize your own rotation behavior
- Blogger: Beyond the Basics: Customize and promote your blog with original templates, analytics, adve
- (OK) how to customize the kernel for your hardware for Android-x86
- VNX5700_DR An error occurred during the login process. The storage processors did not log in proper
- Profile your application in the simulator with 'Zombies' Instrument.
- Your build settings specify a provisioning profile with the UUID
- Your build settings specify a provisioning profile with the UUID
- Your build settings specify a provisioning profile with the UUID
- ios uiview的动画效果
- Java多线程
- 论文学习笔记:GFS
- 算法之旅——快速排序
- 同步和异步的区别(经典)
- Customize your profile during login the linux
- 初学C++常遇到的问题(二)
- YY->POJ 1328
- [Anonymous]判断线段是否相交
- 如何使用微软提供的TCHAR.H头文件?
- SCU 4311: Sum of LCM
- Detours使用说明
- java--打渔晒网问题(时间间隔的获取)
- 《Windows核心编程》---Interlocked原子访问系列函数