linux "ps -ef|grep" 简写为pg 博客分类: linux linux
程序员文章站
2024-03-17 22:21:58
...
1. 执行命令创建pg文件
sudo vi /usr/local/bin/pg
文件内容
#!/bin/bash ps -ef|grep $1
2. 设置权限
sudo chmod 755 /usr/local/bin/pg
完毕!
测试一下语句"pg zookeeper":
hadoop@rick-ubuntu:~$ pg zookeeper hadoop 24231 1 0 14:08 tty2 00:00:01 /usr/lib/jvm/java-8-oracle/bin/java -Dzookeeper.log.dir=. -Dzookeeper.root.logger=INFO,CONSOLE -cp /home/hadoop/work/zookeeper/bin/../build/classes:/home/hadoop/work/zookeeper/bin/../build/lib/*.jar:/home/hadoop/work/zookeeper/bin/../lib/slf4j-log4j12-1.6.1.jar:/home/hadoop/work/zookeeper/bin/../lib/slf4j-api-1.6.1.jar:/home/hadoop/work/zookeeper/bin/../lib/netty-3.7.0.Final.jar:/home/hadoop/work/zookeeper/bin/../lib/log4j-1.2.16.jar:/home/hadoop/work/zookeeper/bin/../lib/jline-0.9.94.jar:/home/hadoop/work/zookeeper/bin/../zookeeper-3.4.6.jar:/home/hadoop/work/zookeeper/bin/../src/java/lib/*.jar:/home/hadoop/work/zookeeper/bin/../conf: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false org.apache.zookeeper.server.quorum.QuorumPeerMain /home/hadoop/work/zookeeper/bin/../conf/zoo.cfg hadoop 27572 26009 0 14:24 pts/0 00:00:00 /bin/bash /usr/local/bin/pg zookeeper hadoop 27574 27572 0 14:24 pts/0 00:00:00 grep zookeeper
同样的方法, 可以创建k9(kill -9) 和tf(tail -f)命令
上一篇: CCF 201503-1 图像旋转
推荐阅读
-
linux systemd: 启用/etc/rc.local 博客分类: linux
-
Spring:一主多从DataSource的读写分离实现 博客分类: spring AbstractRoutingDataSourceSpring
-
FatJar减肥: 解决SpringBoot jar包太大的问题 博客分类: spring Springbootfatjarjar包太大
-
SpringBoot2.0的CacheManager配置 博客分类: spring SpringBoot
-
升级spring boot 2.0遇到的问题汇总 博客分类: spring springboot2.0
-
linux "ps -ef|grep" 简写为pg 博客分类: linux linux
-
dhcp获取ip后自动更新DNS 博客分类: linux
-
CentOS7 笔记 博客分类: linux
-
kubernets: 和谐环境下的kubeadm安装 博客分类: kubernetes kubeadm
-
这广告太没节操了吧 博客分类: others