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 ...
随机推荐
- switch条件语句规则
- CodeForces 609A USB Flash Drives
水题 #include<cstdio> #include<cmath> #include<algorithm> using namespace std; +; in ...
- hibernate--多对一单向关联 (重点!!!)
一个用户组包含多个用户, 每个用户属于一个组. 一个人可以有多个车, 每个车属于一个人. 一个人有很多梦想, 一个特定的梦想属于一个人. 错误做法: person里 有 personid, perso ...
- nginx+fastcgi php 使用file_get_contents、curl、fopen读取localhost本站点.php异常的情况
原文:http://www.oicto.com/nginx_fastcgi_php_file_get_contents/ 参考:http://os.51cto.com/art/201408/44920 ...
- 函数之return
return语句用来从一个函数 返回 即跳出函数.我们也可选从函数 返回一个值 .使用字面意义上的语句~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 例7.7 使用字面意义上的语句 ...
- (中等) HDU 4069 Squiggly Sudoku , DLX+精确覆盖。
Description Today we play a squiggly sudoku, The objective is to fill a 9*9 grid with digits so that ...
- 防止多个UIAlertView重叠弹出
http://www.jianshu.com/p/7ac398ef4532 项目中可能会遇到这种情况,好几个alertView因为逻辑关系全部弹出,用户需要一个个的点击才能将所有的alertView取 ...
- JavaScriptConvert.SerializeObject转换出错
The length of the string exceeds the value set on the maxJsonLength property(字符串的长度超过maxjsonlength上设 ...
- STM32启动模式及API(转)
源:STM32启动模式及API 我们玩ARM9,一般都是在内存里调试程序,速度飞快.STM32下也可以这样,虽说现在的flash寿命已经很长了,但flash中调试烧录程序还是一个很慢的过程,有时候程序 ...
- bzoj3110: [Zjoi2013]K大数查询 【cdq分治&树套树】
模板题,折腾了许久. cqd分治整体二分,感觉像是把询问分到答案上. #include <bits/stdc++.h> #define rep(i, a, b) for (int i = ...