Posts Categorized: unix

Find and Replace Strings in Files

The Wikipedia article on find is great. Searching To check for the existence of the string in any of the files in the directory structure: find . -exec grep -H “searchstring” ‘{}’ \; -print On Solaris ommit the ‘-H’.or using grep only: grep -r “searchstring” /tmp Replacing Find in the current directory (.) type file… Read more »

rsync: fatal: libpopt.so.0: open failed

I was trying to use Rsync on a Solaris machine and received the following error message: ld.so.1: /usr/local/bin/rsync: fatal: libpopt.so.0: open failed: No such file or directory I discovered from http://www.sunmanagers.org/pipermail/sunmanagers/2002-May/014178.html that it is an evil LD_LIBRARY issue which can be overcome with the following (as root): crle -l /usr/lib:/usr/local/lib crle -u

Sun Solaris Screen Resolution

When moving some Sun Solaris servers to a new server room with a new KVM solution (Raritan Paragon 2) we had difficulty getting the Sun servers to display on the KVM. Keyboard seemed to work fine but the display would not. The issue seems to be with the default screen display resolution used on the… Read more »

Killing Memory Hogs

On an old server I temporarily added the following script as a cron job to find and kill processes using too much memory. This is just a stop gap until we get to the root of the problem. #!/bin/bashfor i in `ps -efl | grep “httpd” | awk ‘{ if ($10 > 16000) {print $4″… Read more »

Crontab -e returns a number

On a solaris system I sometimes try to edit the crontab file with crontab -e and all I get in return is a number (signifying the number of characters by the ed editor I believe). # crontab -e4025^C?The crontab file was not changed. I need to Ctrl-D to exit.To get the ball rolling again: EDITOR=vi;export… Read more »