Mac bash rc
######################################
########## .bashrc
######################################
case $- in
*i*) ;;
*) return ;;
esac
# bogus
if [ -f /unix ] ; then
alias ls='/bin/ls -CGF'
else
alias ls='/bin/ls -GF'
fi
alias ll='ls -l'
alias dir='ls -ba'
alias ss="ps -aux"
alias dot='ls .[a-zA-Z0-9_]*'
alias news="xterm -g 80x45 -e trn -e -S1 -N &"
alias c="clear"
alias m="more"
alias j="jobs"
# common misspellings
alias mroe=more
alias pdw=pwd
hash -p /usr/bin/mail mail
if [ -z "$HOST" ] ; then
export HOST=${HOSTNAME}
fi
HISTIGNORE="[ ]*:&:bg:fg"
psgrep()
{
ps -aux | grep $1 | grep -v grep
}
#
# This is a little like `zap' from Kernighan and Pike
#
pskill()
{
local pid
pid=$(ps -ax | grep $1 | grep -v grep | awk '{ print $1 }')
echo -n "killing $1 (process $pid)..."
kill -9 $pid
echo "slaughtered."
}
term()
{
TERM=$1
export TERM
tset
}
xtitle ()
{
echo -n -e "\033]0;$*\007"
}
cd()
{
builtin cd "$@" && xtitle $HOST: $PWD
}
bold()
{
tput smso
}
unbold()
{
tput rmso
}
if [ -f /unix ] ; then
clear()
{
tput clear
}
fi
rot13()
{
if [ $# = 0 ] ; then
tr "[a-m][n-z][A-M][N-Z]" "[n-z][a-m][N-Z][A-M]"
else
tr "[a-m][n-z][A-M][N-Z]" "[n-z][a-m][N-Z][A-M]" < $1
fi
}
watch()
{
if [ $# -ne 1 ] ; then
tail -f nohup.out
else
tail -f $1
fi
}
#
# Remote login passing all 8 bits (so meta key will work)
#
rl()
{
rlogin $* -8
}
function setenv()
{
if [ $# -ne 2 ] ; then
echo "setenv: Too few arguments"
else
export $1="$2"
fi
}
function chmog()
{
if [ $# -ne 4 ] ; then
echo "usage: chmog mode owner group file"
return 1
else
chmod $1 $4
chown $2 $4
chgrp $3 $4
fi
}
######################################
########## .PS1
######################################
if [ -z "$PS1" ]; then
return
fi
PS1='\e[35;36m[\u@\w] $\e[0m '
######################################
########## .git-completion.bash
######################################
source ~/.git-completion.bash
######################################
########## brew
######################################
export PATH=$PATH:/Users/xiaomi/opt/brew/bin
Mac bash rc的更多相关文章
- mac -bash: ll: command not found
在linux系统下我们经常使用ll.la命令.但在mac系统时缺没有. 提示:-bash: ll: command not found. 这是因为ll.la不是真的命令,而是一些常用命令和参数搭配的别 ...
- MAC bash和zsh切换
bash和zsh切换 切换到bash chsh -s /bin/bash 切换到zsh chsh -s /bin/zsh 记得输入切换命令后,要重新打开终端terminal才生效哦!大功告成!
- mac bash 下使用vi 快捷方式——因为没有alt键 所以没有办法 用vi模式也非常方便的
set -o emacs ##切到emacs模式 set -o vi ##切到vi模式 set -o ## 查看当前选项的设置状态 所以你只需要在.bashrc下加入 set -o vi 然后,使用E ...
- mac bash上显示git分支与状态
主要实现 显示当前路径 显示当前所在分支 显示当前修改状态 = 表示一个干净的分支 ~ 表示文件有改动 # 表示已commit 但未 push 通过网上搜索和自己根据实际需要修改的代码如下: .bas ...
- linux bash & profile &bash_profile 小结
login 方式:: su - oracle 依次 /etc/bash.bashrc———— /home/$user/.bashrc ———— /ect/profile ———— /home/$use ...
- Mac OS X 系统下自带的文本文件格式转换工具iconv
1. utf-8 转 GBK的方法 在mac bash 中直接运行 iconv -f UTF-8 -t GBK test_utf8.txt > test_gbk.txt 举例:创建测试文件 ec ...
- 【Linux相识相知】bash的基础特性
命令历史 shell进程会记录用户提交执行过的命令 可以是用history查看: [root@localhost dev]# history ss -tnl ifconfig vi /etc/sysc ...
- 【Linux相识相知】bash的特性
命令历史 shell进程会记录用户提交执行过的命令 可以是用history查看: [root@localhost dev]# history ss -tnl ifconfig vi /etc/sysc ...
- mac apt-get--> Homebrew
在最近采集linux进程网络指标的时候,为了对比采集结果,需要linux系统查看进程网络流量命令,最后查到nethogs 这个工具好用,但是在下载安装过程中碰到问题: 1:http://blog.cs ...
随机推荐
- clearsSelectionOnViewWillAppear
@property (nonatomic) BOOL clearsSelectionOnViewWillAppear NS_AVAILABLE_IOS(3_2); // defaults to YES ...
- Android Service生命周期 Service里面的onStartCommand()方法详解
在Demo上,Start一个Service之后,执行顺序:onCreate - > onStartCommand 然后关闭应用,会重新执行上面两步. 但是把代码拷贝到游戏工程发现,关闭游戏后,只 ...
- linux shell 之if-------用if做判断
综合网络,略有修改, 一 简介 1 字符串判断 str1 = str2 当两个串有相同内容.长度时为真 str1 != str2 当串str1和str2不等时为真 -n str1 当串的长度大于0 ...
- 23、手把手教你Extjs5(二十三)模块Form的自定义的设计[2]
在本节中将要加入各种类型的字段,在加入字段的时候由于可以一行加入多个字段,因此层次结构又多了一层fieldcontainer.form里面的主要层次结构如下: form -- fieldSet -- ...
- Mapreduce TopK
思想比较简单,就是每个通过map来获取当前的数据块中的的topk个数据,然后将他们以相同的key值放到reduce中,最后通过reduce来对这n*k个数据排序并获得topk个数据.具体的就是建立 ...
- 网络IO模型
同步(synchronous) IO和异步(asynchronous) IO,阻塞(blocking) IO和非阻塞(non-blocking)IO分别是什么,到底有什么区别?这个问题其实不同的人给出 ...
- IOS之富文本编辑
之前做项目时遇到一个问题: 使用UITextView显示一段电影的简介,由于字数比较多,所以字体设置的很小,行间距和段间距也很小,一大段文字挤在一起看起来很别扭,想要把行间距调大,结 ...
- JQuery中 json 和字符串直接相互转换
json字符串转json对象:jQuery.parseJSON(jsonStr); json对象转json字符串:JSON.stringify(jsonObj); IE中可能对unicode使用“ ...
- 非root用户Memcached repcached安装
安装memcached前先要确定系统是否安装了gcc: 1.解压安装包: tar -zxf memcached-1.2.8-repcached-2.2.tar.gz 2.编译: 系统应安装了libev ...
- JAVA WEB 中的编码分析
JAVA WEB 中的编码分析 */--> pre.src {background-color: #292b2e; color: #b2b2b2;} pre.src {background-co ...