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 ...
随机推荐
- 用java.util.Observable实现Observer模式
http://blog.csdn.net/dada360778512/article/details/6977758 http://blog.csdn.net/luoweifu/article/det ...
- hibernate--ID生成策略--XML
xml生成id, a) generator b) 常用4个: native, uuid, identity, sequence 1. 新建java项目, 引入hibernate, junit(use ...
- 用 JS 点击左右按钮 使图片切换 - 最精简版-ljx2380000-ChinaUnix博客
body { font-family: "Microsoft YaHei UI","Microsoft YaHei",SimSun,"Segoe UI ...
- (简单) POJ 2029 Get Many Persimmon Trees,暴力。
Description Seiji Hayashi had been a professor of the Nisshinkan Samurai School in the domain of Aiz ...
- Mysql 常用引擎的特点及选择使用策略
Mysql 常用引擎的特点及选择使用策略 Mysql数据库常用存储引擎 Mysql数据库是一款开源的数据库,支持多种存储引擎的选择,比如目前最常用的存储引擎有:MyISAM,InnoDB,Memory ...
- Android线程之Thread 、Runnable 的两个例子
Thread例子: package fy.test; import android.app.Activity; import android.os.Bundle; import android.os. ...
- iOS开发——点击图片全屏显示
点击图片,全屏显示,然后再点击屏幕一下,返回. 没啥难的,直接上代码: // // ViewController.m // Demo-hehe // // Created by yyt on 1 ...
- 51驱动LCD12864
LCD12864与LCD1602最大的区别在于LCD12864可以显示汉字,同时也可以拿来画图;当然,作为图形显示不推荐lcd12864,推荐NOKIA5110 12864引脚基本和1602的引脚吻合 ...
- UIAlertView使用全解
举例: UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Default Alert View"messa ...
- UOJ #192 【UR #14】 最强跳蚤
题目链接:最强跳蚤 这道题本来不想写博客的--但是鉴于自己犯了低级错误,还是写篇博客记载一下. 一开始我的想法和题解里面的算法而比较类似,也是先分解质因数,然后用质因子是否出现偶数次来判断当前这个数是 ...