######################################

########## .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的更多相关文章

  1. mac -bash: ll: command not found

    在linux系统下我们经常使用ll.la命令.但在mac系统时缺没有. 提示:-bash: ll: command not found. 这是因为ll.la不是真的命令,而是一些常用命令和参数搭配的别 ...

  2. MAC bash和zsh切换

    bash和zsh切换 切换到bash chsh -s /bin/bash 切换到zsh chsh -s /bin/zsh 记得输入切换命令后,要重新打开终端terminal才生效哦!大功告成!

  3. mac bash 下使用vi 快捷方式——因为没有alt键 所以没有办法 用vi模式也非常方便的

    set -o emacs ##切到emacs模式 set -o vi ##切到vi模式 set -o ## 查看当前选项的设置状态 所以你只需要在.bashrc下加入 set -o vi 然后,使用E ...

  4. mac bash上显示git分支与状态

    主要实现 显示当前路径 显示当前所在分支 显示当前修改状态 = 表示一个干净的分支 ~ 表示文件有改动 # 表示已commit 但未 push 通过网上搜索和自己根据实际需要修改的代码如下: .bas ...

  5. linux bash & profile &bash_profile 小结

    login 方式:: su - oracle 依次 /etc/bash.bashrc———— /home/$user/.bashrc ———— /ect/profile ———— /home/$use ...

  6. Mac OS X 系统下自带的文本文件格式转换工具iconv

    1. utf-8 转 GBK的方法 在mac bash 中直接运行 iconv -f UTF-8 -t GBK test_utf8.txt > test_gbk.txt 举例:创建测试文件 ec ...

  7. 【Linux相识相知】bash的基础特性

    命令历史 shell进程会记录用户提交执行过的命令 可以是用history查看: [root@localhost dev]# history ss -tnl ifconfig vi /etc/sysc ...

  8. 【Linux相识相知】bash的特性

    命令历史 shell进程会记录用户提交执行过的命令 可以是用history查看: [root@localhost dev]# history ss -tnl ifconfig vi /etc/sysc ...

  9. mac apt-get--> Homebrew

    在最近采集linux进程网络指标的时候,为了对比采集结果,需要linux系统查看进程网络流量命令,最后查到nethogs 这个工具好用,但是在下载安装过程中碰到问题: 1:http://blog.cs ...

随机推荐

  1. javascript 实现加法分离。 plus(3)(4); // => 得到 7

    原文地址:http://cnodejs.org/topic/5230d5f0101e574521c86ff4 JavaScript 的设计是典型的函数式的编程范式匿名函数 JSON数据本身就是字符串, ...

  2. 一个简单但详细的解释Windows文件映射读取数据文件的例子

    #include <windows.h>#include <string.h>#include <string>#include <iostream>u ...

  3. Tinyproxy

    Tinyproxy Tinyproxy is a light-weight HTTP/HTTPS proxy daemon for POSIX operating systems. Designed ...

  4. JQuery收集

  5. php的autoload机制

    php5版本中,当你尝试使用一个未定义的类或者接口时,会自动调用__autoload()函数 例如1 <?php function __autoload($class_name){ includ ...

  6. 编写一个python脚本功能-备份

    版本一 解决方案当我们基本完成程序的设计,我们就可以编写代码了,它是对我们的解决方案的实施.版本一例10.1 备份脚本——版本一 #!/usr/bin/python # Filename: backu ...

  7. [Unity Quaternion]四元数Quaternion的计算方式

    什么是Quaternion四元数 1843年,William Rowan Hamilton发明了四元数,但直到1985年才有一个叫Ken Shoemake的人将四元数引入计算机图形学处理领域.四元数在 ...

  8. 冯如杯day1

    day1 今天尝试配置了seetaface工程 主要按照这个网址中提示的步骤配置seetaface 第一步安装并配置OpenCV 按照这个网址进行配置,结果遇到了这样的错误 无法启动此程序,因为计算机 ...

  9. mysql 数据库 切表的脚本

    #!/bin/sh host=$1 port=$2 host=${host:="localhost"}  #host没赋值,那么就赋值为localhost port=${port: ...

  10. Phone APP设计规范/iPad APP设计规范/Android APP设计规范/网页设计规范

    原文链接:http://www.ui001.com/chicun/ ①iPhone的设计尺寸 iPhone界面尺寸: 设备 分辨率 状态栏高度 导航栏高度 标签栏(工具栏)高度 iPhone6 plu ...