设置".profile"文件,简化操作

OpenBSD的安装、升级、更新等日常问题。

版主: chenjun天地乾坤

回复
头像
leo
帖子: 2465
注册时间: 2010-01-21 3:27

设置".profile"文件,简化操作

帖子 leo » 2011-05-30 9:03

我一般也就是设置一下PKG_PATH路径什么的,这样可以在OpenBSD上直接用pkg_add命令来安装软件包,就像centos的yum和ubuntu的apt-get一样方便,选择最快的服务器再将路径设置好就行了。

这里找到一个比较全的,共享出来。
原文地址:http://www.bamweb.nl/computer/bsd/43
Written by Bart Dorlandt Sunday, 10 June 2007 15:54 Here you'll find the profile I created for OpenBSD. This profile is based on KSH. The first is the user profile, the second the root profile.
User Profile
####### Aliases #######
alias ll='ls -lhF'
alias la='ls -lahF'
alias l='ls -CF'
alias llt='ls -lhtF|head'
alias lat='ls -lahtF| head'
alias aoeu='kbd us'
alias asdf='kbd us.dvorak'
alias sud='sudo su -l root'
alias more="less"
alias untar="tar xzpf"
alias pstree="pstree -w"
PAGER=/usr/bin/less

####### Colored Shell #######
e=`printf "\033"`
end="$e[0m"
red="$e[1;31m"
green="$e[1;32m"
yellow="$e[1;33m"
blue="$e[1;34m"
magenta="$e[1;35m"
darkcyan="$e[36m"
unset e
PS1='${darkcyan}$(jot -s "" -b "." ${COLUMNS})${end}
${blue}$(id -un)@$(hostname)${end}: ${green}${PWD}${end} $(date "+%F %T")
\$ '

####### PKG_PATH settings #######
PKG_PATH=ftp://ftp.openbsd.org/pub/`uname -s`/`uname -r`/packages/`uname -m`/:ft
p://ftp.nluug.nl/pub/`uname -s`/`uname -r`/packages/`uname -m`/

####### History (touch ~/.ksh_history) #######
HISTFILE=~/.ksh_history

####### Export settings #######
export HOME PS1 PAGER HISTFILE PKG_PATH

Root profile
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin
HOME=/root
umask 022

####### Aliases #######
alias ll='ls -lhF'
alias llt='ls -lhtF|head'
alias la='ls -lahF'
alias lat='ls -lahtF| head'
alias l='ls -CF'
alias shut='shutdown -hp now'
alias reboot='shutdown -r now'
alias untar="tar xzpf"
alias aoeu='kbd us'
alias asdf='kbd us.dvorak'
alias more="less"
alias pstree="pstree -w"
PAGER=/usr/bin/less

if [ -x /usr/bin/tset ]; then
eval `/usr/bin/tset -sQ \?$TERM`
fi

####### Colored Shell #######
e=`printf "\033"`
end="$e[0m"
red="$e[1;31m"
green="$e[1;32m"
yellow="$e[1;33m"
blue="$e[1;34m"
magenta="$e[1;35m"
darkcyan="$e[36m"
unset e
PS1='${red}$(jot -s "" -b "." ${COLUMNS})${end}
${yellow}$(id -un)@$(hostname)${end}: ${green}${PWD}${end} $(date "+%F %T")
# '

####### PKG_PATH settings #######
PKG_PATH=ftp://ftp.openbsd.org/pub/`uname -s`/`uname -r`/packages/`uname -m`/:ft
p://ftp.nluug.nl/pub/`uname -s`/`uname -r`/packages/`uname -m`/

####### History (touch ~/.ksh_history) #######
HISTFILE=~/.ksh_history

####### Export settings #######
export PATH HOME PS1 PAGER HISTFILE PKG_PATH

woodelf
钛 Ti
帖子: 33
注册时间: 2010-09-01 11:23

回复: 设置".profile"文件,简化操作

帖子 woodelf » 2011-05-30 15:28

这配置相当不错,还把终端的功能顺手强化了下。

回复

在线用户

正浏览此版面之用户: 没有注册用户 和 5 访客