欢迎光临
我们一直在努力

工作中常用的Linux命令

1. nohup

模式启动

weblogic

     1.启动war包) nohup ./startweblogic.sh &  

2.启动jar包) nohup java -jar xbp-cwhs-cwzw.jar &

 

2.

查看

weblogic

后台日志

           tail  -f  nohup.out

显示500行

tail -500 nohup.out

 

3.

查看当前进程

         ps  -ef|grep  jdk

 

4.

结束进程

    kill  -9

进程号

 

5.

查看网络匹配

         ifconfig

 

6.

文件所有者更改

         chown  -R 

用户名

 

文件

/

目录

 

7.更改文件权限

         chown  777 

文件名

 

8.

删除文件

         rm  -rf 

文件名

 

9.

解压文件

         1.unzip  common.war

(文件名)

  -d  common

(文件夹名)


2.jar xvf

common.war

 

10.

查看防火墙状态

         service   iptables   status

11.防火墙启动关闭


      service iptables stop –停止


     service iptables start –启动

12.重启docker

systemctl restart docker

13.重启网络服务

service netkork restart

14.清空文件内容

[root@centos7 ~]# du -h test.txt


4

.0K    test.txt

[root@centos7 ~]# > test.txt

[root@centos7 ~]# du -h test.txt
   test.txt

15 查看路由状态

route -e

16 开启 rabbitmq

  service rabbitmq-server start

17 查询8080端口是被哪个程序占用了

netstat –anp | grep 8080

18 linux 启动oracle


$ su – oracle 

19 linux 测试端口

ssh -v -p port


username@ip


20 traceroute  ip   跟踪路由

22 将dir1下所有文件复制到dir2下了. 如果dir2目录不存在,则可以直接使用

cp -r dir1 dir2

即可。如果dir2目录已存在,则需要使用

cp -r dir1/. dir2

23 查询当前时间

date -R

24 查看ip地址

ifconfig -a

25 单独执行类的main方法

(依赖jar包)         (包名)(main方法路径)

linux  环境      java -cp .:amqp-client-3.3.4.jar:1.jar com.test.rabbitmq.RabbitmqInit

打开cmd命令窗口

window 环境    java -cp .;amqp-client-3.3.4.jar;.;1.jar com.test.rabbitmq.RabbitmqInitForYDZYJX

26 查看系统运行内存信息

free -h

27 查看当前机器ip

hostname -i

28 查看主机名

hostname

29 设置主机名称

hostname xxx

赞(0)
【声明】:本博客不参与任何交易,也非中介,仅记录个人感兴趣的主机测评结果和优惠活动,内容均不作直接、间接、法定、约定的保证。访问本博客请务必遵守有关互联网的相关法律、规定与规则。一旦您访问本博客,即表示您已经知晓并接受了此声明通告。