Archive for July, 2008

Clearcase Tip : unreserved checkout

This simple tip is for those who are using clearcase command line interface for work.

In clearcase command line to checkout a file or directory, we type

>cleartool co <file/dir name>

Unfortunately the default checkout option in clearcase is reserved. How to change this default setting to unreserved?

1. create a .clearcase_profile file in your home directory and enter this line,

checkout -unreserved

2. In .bashrc

export CLEARCASE_PROFILE=~/.clearcase_profile

Learned from here.

Leave a Comment

Unix Tip: find command

Every one knows that find is an indispensable tool when you are working on Unix.  But how many of you know about the -follow flag?

I was using it for years and till yesterday i haven’t come across an issue with the command.

Yesterday evening i was trying to locate an *.so file and noticed this interesting behaviour.

bash-3.00# pwd
/apps/jsws/webservers/https-ws.advisorchannel.com-444/components/fmr-plugins
bash-3.00# find ./ -name ‘*.so’ | wc -l
78
bash-3.00# cd ..
bash-3.00# find ./ -name ‘*.so’ | wc -l
0

When i do a find from one location, it says.. there are 78 files. When i just move back and run the find command again… it gives zero. Strange…!!! rite?

It took some time for me to figure out why this strange behavior was occurring.

I was about to send out an email  telling that ‘.so’ files are missing.. then i noticed this,

bash-3.00# ls -l
total 2
lrwxrwxrwx   1 httpdadm httpdadm      26 Jul  8 10:01 fmr-plugins -> /apps/fmr-plugins/TKP15S02
lrwxrwxrwx   1 httpdadm httpdadm      31 Jul  8 10:01 jsws -> /apps/jsws/httpd/JSWS-7.0.1_S15

Ok, so that is the reason.  Two of the sub directories under “components” are symlinks.

Find command, by default, does not recursively traverse symlinks. You need to add -follow flag.

bash-3.00#find ./ -name ‘*.so’ -follow | wc -l
273

Comments (2)

Solaris : How to find files opened by a program

Get the pid of the program

$ps -ef | grep “program name”

$pfiles <pid>

This will
list all the files and sockets used by the program.

Leave a Comment