Linux学习

ubuntu source.list源(注意官方源一定要加上)


#这里你也可以直接使用更快速的ubuntu.cn99.com的源(推荐):

deb http://ubuntu.cn99.com/ubuntu/ oneiricmain restricted universe multiverse
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设置

一、配置ip
     ubuntu的网络配置信息放在 /etc/network/interfaces 中,
     如果配置动态获取ip,则在上述文件中加入以下内容:
     auto eth0
     iface eth0 inet dhcp
     如果配置静态ip,则添加如下内容:
     auto eth0
     iface eth0 inet static
     address 192.168.33.201
     netmask 255.255.255.0
     gateway 192.168.33.1
     要是配置生效,需要重启网卡:
     ifconfig eth0 down
     ifconfig eth0 up
二、配置dns服务器
         ubuntu 的dns服务器信息,放在 /etc/resolv.conf中,
         添加dns服务器地址,如202.112.125.53,则在上述文件中加入
          nameserver  202.112.125.53
重启下网络服务
             /etc/init.d/networking restart

查找指定文件名(递归)

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


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值