ubuntu source.list源(注意官方源一定要加上)
#这里你也可以直接使用更快速的ubuntu.cn99.com的源(推荐):
deb http://ubuntu.cn99.com/ubuntu/ oneiric-updates main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ oneiric-security main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ oneiric-backports main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu-cn/ oneiricmain restricted universe multiverse
#台湾源(kuai)
deb http://tw.archive.ubuntu.com/ubuntu/ oneiric main universe restricted multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu/ oneiric main universe restricted multiverse
deb http://tw.archive.ubuntu.com/ubuntu/ oneiric-security universe main multiverse restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ oneiric-security universe main multiverse restricted
deb http://tw.archive.ubuntu.com/ubuntu/ oneiric-updates universe main multiverse restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ oneiric-updates universe main multiverse restricted
deb http://archive.ubuntu.com/ubuntu/ natty main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ natty-security main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ natty-updates main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ natty-proposed main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ natty-backports main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ natty main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ natty-security main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ natty-updates main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ natty-proposed main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ natty-backports main restricted universe multiverse
deb http://mirrors.geekbone.org/ubuntu natty main restricted universe multiverse deb http://mirrors.geekbone.org/ubuntu natty-security main restricted universe multiverse deb http://mirrors.geekbone.org/ubuntu natty-updates main restricted universe multiverse deb http://mirrors.geekbone.org/ubuntu natty-backports main restricted universe multiverse deb http://mirrors.geekbone.org/ubuntu natty-proposed main restricted universe multiverse deb-src http://mirrors.geekbone.org/ubuntu natty main restricted universe multiverse deb-src http://mirrors.geekbone.org/ubuntu natty-security main restricted universe multiverse deb-src http://mirrors.geekbone.org/ubuntu natty-updates main restricted universe multiverse deb-src http://mirrors.geekbone.org/ubuntu natty-backports main restricted universe multiverse deb-src http://mirrors.geekbone.org/ubuntu natty-proposed main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ natty main restricted universe multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ natty-security main restricted universe multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ natty-updates main restricted universe multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ natty-backports main restricted universe multiverse deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ natty-proposed main restricted universe multiverse deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ natty main restricted universe multiverse deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ natty-security main restricted universe multiverse deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ natty-updates main restricted universe multiverse deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ natty-backports main restricted universe multiverse deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ natty-proposed main restricted universe multiverse
远程ssh连接
ssh -l root -X 10.10.10.10
编译使用静态库
gcc -c static_mylib.c
ar -rcs static_mylib.a static_mylib.c
gcc main.c -static ./static_mylib.a -o app
编译使用动态库
gcc -shared -fPIC -o share_mylib.so mylib.c
gcc main.c ./share_mylib.so -o app
IP设置
查找指定文件名(递归)
find ./ -name "*.txt" -maxdepth 1
查找指定内容(递归)
grep ./ -lr 'main(' *
让脚本暂停运行
function pause(){
read -p "$*"
}
pause 'Press any key to continue…'
查看目录使用情况
du -h
编码转换
iconv -f UTF-8 -t GB18030 main.c > daib.tmp;mv daib.tmp main.c
查找文件
find . -maxdepth 1 \( -name "*.h" -o -name "*.c" \)
解压xz后缀文件
xz -d ***.tar.xz
tar -xvf ***.tar