Category Archives: unix

Replace end of lines with commas in sed

Need to extract numbers and create a comma separated list: $ sed -e :label -e N -e ‘s/\n/, /’ -e ‘s/[ |]//g’ -e tlabel <<xxxx > |     919 | > |    1027 | > |    1593 … Continue reading

Posted in unix | Tagged , , , | Leave a comment

strace – trace system calls and signals

Nice little program that might be used in linux to find what files were open by the process. For example: strace ls 2>&1|grep “open”

Posted in unix | Tagged , , , | Leave a comment

How to find what application is using network port in linux?

netstat -nlp will give you an idea. [root@os]# netstat -nlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name tcp        0      0 0.0.0.0:9921                0.0.0.0:*                   LISTEN      10982/ora_d000_orcl tcp        0      0 10.10.10.10:1521           0.0.0.0:*                   LISTEN      12516/tnslsnr tcp        … Continue reading

Posted in unix | Tagged , , , , | Leave a comment

Bacula backup

Backup job stopped with: Device is BLOCKED waiting to create a volume for: It means that bacula ran out of volumes or space on disk and want you to create new volume manually. Use “Label”, enter new volume name, assign … Continue reading

Posted in unix | Tagged , , , | Leave a comment

When you use ‘find’ and ‘zip’ in one sentence…

Instead of find albums -name *.jpg -not -name *.sized.jpg -not -name *.thumb.jpg -not -name *.highlight.jpg -exec zip -r -1 album.zip {} ;& use find albums -name *.jpg -not -name *.sized.jpg -not -name *.thumb.jpg -not -name *.highlight.jpg -print| zip -1 album.zip … Continue reading

Posted in unix | Tagged , | Leave a comment