Linux/Unix命令

MAC 中自定义环境变量

打开:nano .bash_profile

查看:cat text

保存退出:Ctrl+C,Y

#在.bash_profile 中添加tree
alias tree="find . -print |sed -e 's;[^/]*/;|___;g;s;___|;|;g'"

#语法着色
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced

#立即生效
source .bash_profile

 解压安装文件:

#解压安装Django
tar xzvf Django-X.Y.tar.gz
cd Django-X.Y
python setup.py install

查看到底:

http://www.cnblogs.com/peida/archive/2012/10/23/2734829.html

ls -l -R

-R, –recursive 同时列出所有子目录层

例一:列出/home/peidachang文件夹下的所有文件和目录的详细资料

命令:ls -l -R /home/peidachang

-t 以文件修改时间排序

uname -r 显示正在使用的内核版本 
date 显示系统日期 
cal 2007 显示2007年的日历表

cd .. 返回上一级目录
pwd 显示工作路径 
ls 查看目录中的文件 


mkdir dir1 创建一个叫做 'dir1' 的目录' 
mkdir dir1 dir2 同时创建两个目录 
mkdir -p /tmp/dir1/dir2 创建一个目录树 
rm -f file1 删除一个叫做 'file1' 的文件' 


mv dir1 new_dir 重命名/移动 一个目录 
cp file1 file2 复制一个文件 
cp dir/* . 复制一个目录下的所有文件到当前工作目录


touch

find

find /usr/bin -type f -mtime -10 搜索在10天内被创建或者修改过的文件

chmod 777

unrar x file1.rar 解压rar包 
tail -2 file1 查看一个文件的最后两行

参考引用自@http://www.php100.com/html/webkaifa/Linux/2009/1106/3485.html