1、使用在shell脚本中删除使用端口号5910的进程(通过端口号删除进程):
-
result=`(netstat -tlnp|grep 5910|awk '{print $7}'|awk -F "/" '{print $1}')`;
-
if [ $result ];then
-
kill $result
-
fi
2、Ubuntu ip配置
vim /etc/network/interfacesvim /etc/network/interfaces
-
iface eth0 inet static
-
address 10.10.xx.xxx
-
gateway 10.10.xx.x
-
netmask 255.255.248.0
vi /etc/resolv.conf
/etc/init.d/network restart
3、Ubuntu路径过长:
(tg2env)xxxx@ubuntu:~/convirt/tg2env/addressbook$
修改步骤
sudo vim ~/.bashrc
PS1相关的做修改
/w改成/W,就是小写的w改成大写W
以下一段是修改过后的:
-
if [ "$color_prompt" = yes ]; then
-
PS1='${debian_chroot:+($debian_chroot)}@\[\033[01;34m\]\W\[\033[00m\]\$ '
-
else
-
PS1='${debian_chroot:+($debian_chroot)}@\W\$ '
-
fi
-
unset color_prompt force_color_prompt
-
-
# If this is an xterm set the title to user@host:dir
-
case "$TERM" in
-
xterm*|rxvt*)
-
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}@\W\a\]$PS1"
-
;;
-
*)
保存退出终端,再打开路径就短多了(tg2env)@tg2env$
另:
/u 显示username
/h 显示hosename
/W 显示当前目录
阅读(2702) | 评论(0) | 转发(0) |