Wednesday, April 5, 2017

Useful command combination in System Administration

Useful command combination in System Administration

Once you are in a linux box, these commands will help you to save your time a lot.

[root@linuxblack tmp]# ps aux|grep nagios | awk '{print $2}'|xargs kill -9 to kill the process owned by nagios


[root@linuxblack tmp]# ll | grep 02:1| awk '{print $9}'| xargs gzip list and zip the files in a dir whose time is 02:1


[root@linuxblack tmp]# ll | grep Jul| awk '{print $9}'| xargs du -hs - list and display the disk usage


[root@linuxblack tmp]# lsof -i TCP:443|awk '{print $2}'|xargs kill -9 Kill the process listening on port 443

No comments:

Post a Comment