Monday, December 22, 2014

Useful Unix / Linux shell commands


 cat tmp.txt | sed s/CREATE/DROP/


 who | cut -c1-8 | sort | uniq | nl
 cat /usr/local/apache2/logs/access_log | grep 128\.135 | cut -c1-16 | uniq     
 ps -ef | grep nohup | cut -c53-57 | sort | uniq | nl 

 /sbin/shutdown -r now ?
 lsof

 /etc/rc.local  # system startup configuration

 grep CREATE ensembl_mart_16_1.sql | sed s/CREATE/DROP/ | sed s/\(/\;/ > $HOME/trim_mart.sql

ls enc.* | sed "s/^/\"/" | sed "s/$/\"\,/"

No comments:

Post a Comment