Chinaunix首页 | 论坛 | 博客
  • 博客访问: 261235
  • 博文数量: 10
  • 博客积分: 256
  • 博客等级: 二等列兵
  • 技术积分: 737
  • 用 户 组: 普通用户
  • 注册时间: 2012-08-23 19:28
文章分类

全部博文(10)

文章存档

2016年(2)

2015年(2)

2014年(2)

2013年(3)

2012年(1)

分类: LINUX

2013-12-25 14:28:07

1、使用在shell脚本中删除使用端口号5910的进程(通过端口号删除进程):

点击(此处)折叠或打开

  1. result=`(netstat -tlnp|grep 5910|awk '{print $7}'|awk -F "/" '{print $1}')`;
  2. if [ $result ];then
  3.     kill $result
  4. fi

2、Ubuntu ip配置
vim /etc/network/interfacesvim /etc/network/interfaces

点击(此处)折叠或打开

  1. iface eth0 inet static
  2. address 10.10.xx.xxx
  3. gateway 10.10.xx.x
  4. netmask 255.255.248.0
vi /etc/resolv.conf

点击(此处)折叠或打开

  1. nameserver 10.xx.x.xxx
 /etc/init.d/network restart

3、Ubuntu路径过长:
    (tg2env)xxxx@ubuntu:~/convirt/tg2env/addressbook$
修改步骤
sudo vim ~/.bashrc
PS1相关的做修改
/w改成/W,就是小写的w改成大写W
以下一段是修改过后的:

点击(此处)折叠或打开

  1. if [ "$color_prompt" = yes ]; then
  2.     PS1='${debian_chroot:+($debian_chroot)}@\[\033[01;34m\]\W\[\033[00m\]\$ '
  3. else
  4.     PS1='${debian_chroot:+($debian_chroot)}@\W\$ '
  5. fi
  6. unset color_prompt force_color_prompt

  7. # If this is an xterm set the title to user@host:dir
  8. case "$TERM" in
  9. xterm*|rxvt*)
  10.     PS1="\[\e]0;${debian_chroot:+($debian_chroot)}@\W\a\]$PS1"
  11.     ;;
  12. *)
保存退出终端,再打开路径就短多了(tg2env)@tg2env$

另:
/u 显示username 
/h 显示hosename 
/W 显示当前目录

阅读(2648) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~