linux基础知识
linux基础知识最近使用linux较多,将相关的基础知识记录下来,备忘。
复制:cp
进入目录:cdcd ..
创建文件:mkdir
移动文件/重命名:mv aaa.xx bbb.xx
解压war:jar –xvf xx.war :
解压:tar –xvf xx.tar
压缩:tar –cvf ***
http://www.linuxdiyf.com/viewarticle.php?id=72806
查找tomcat进程
ps –ef|grep tomcat
ps –aux|grep tomcat
Kill 指定线程:
ps -ef|grep index|grep -v grep |awk '{print "kill -9",$2}'|sh
ps -ef|grep index|awk '{print $2}'|xargs kill -9
查找当前目录下文件:
find . -name "index_main*"
删除指定名称文件:
find . -name "index_main*" |xargs -n 1 rm –f
查看磁盘空间:
df –h
du –h
查看磁盘:fdisk -l
创建软链接:
ln -s /lib/libexpat.so.1 /usr/lib/libexpat.so.0
查看文件句柄数:
lsof -n|grep tomcat|awk '{print $2}'|sort|uniq -c |sort -nr|more
切换用户:su - ***
环境变量:/etc/profile ~/.bash_profile
编辑环境变量:vi /etc/profile vi ~/.bash_profile
加载环境变量:source /etc/profile source ~/.bash_profile
查看服务:service ***
挂载磁盘: mount –t nfs 192.168.1.100:/tmp/mnt/nfs
启动服务配置:chkconfig
页:
[1]