linux基本命令用法

[root@localhost ~]#cd /             跳转到根目录
[root@localhost /]# ls            显示当前目录文件

[root@localhost gmtool]# ps -ef| grep java            查看当前目录的进程

[root@localhost gmtool]# kill -9 进程号(进程名后面紧跟的那个数字)            强行杀掉进程

[root@localhost gmtool]# kill -15 进程号(进程名后面紧跟的那个数字)            结束进程

[root@localhost gmtool]# vi 文件           打开文件(此文件不是包或文件夹)

进入文件后,编辑文件需按  i  ,编辑完后按 esc 退出编辑文件模式, 然后按 :wq 保存退出文件

[root@localhost gmtool]# ./run.sh           执行sh文件,此处不能直接写run.sh,必须使用相对或绝对路径

[root@localhost gmtool]# exit            退出linux系统

sh文件需要一个虚拟屏幕使其长期运行

[root@localhost gmtool]# screen -dmS gm(虚拟屏幕名字)         创建虚拟屏幕

[root@localhost gmtool]# screen -r gm            连接虚拟屏幕

此时进入虚拟屏幕,进行相关操作

[root@localhost gmtool]# ctrl+A+D           退出虚拟屏幕

[root@localhost ~]# su -oracle           跳转到oracle用户,命令后有空格

 [root@localhost gmtool]# cp -r lib /gmtooltw        复制gmtool目录下的lib目录到根目录下gmtooltw目录

 [root@localhost gmtool]# cp -i run.sh /gmtooltw     复制gmtool目录下的文件run.sh到根目录下gmtooltw目录

[root@localhost gmtool]# chmod a+x run.sh      给run.sh文件添加执行访问权限

[root@localhost gmtool]#zip -r gmtool.zip ./*     将当前目录下的所有文件以子文件压缩成gmtool.zip文件

[root@localhost gmtool]# unzip classes.zip -d /wwwroot/gmTest/classes      解压classes文件到/wwwroot/gmTest/classes目录

[root@localhost ~]#mkdir file     创建文件夹file

[root@localhost ~]#rm -rf file     移除文件夹file

[root@localhost ~]#/etc/init.d/mysql restart     重启mysql

[root@WHO74113 logs]# tail -f catalina.out      打开tomcat下的日志文件以dos界面显示

[root@localhost ~]#find / -name 'gmtool'      查找文件gmtool

[root@localhost ~]#less gmComm.txt   进入gmComm.txt文件,然后ctrl + f,接着/,最后输入查找字符       在文件内查找相应字符

猜你喜欢

转载自klts.iteye.com/blog/1218787