|
| | Change permissions only for directories
A quck tip on how to change permissions for directories under a directory tree without changing permissions for files.
In this example all sub directories under the current directory will have execute bit set for owner, group and everyone else:
find . -type d -exec chmod a+x {} \;
| |  More... 12/16/06 | | | | |
|
| | Show parent processes for zombies
Use this script to display all processes related (parents and children) to zombie processes on a Unix system. In this case processes are run by user oracle.
#!/bin/ksh
ZOMBIES=`ps -ef|grep oracle|grep 'defunct'|grep -v grep|awk '{printf("%s ", $2);}'`
if [ "X${ZOMBIES}" == "X" ] ; then
echo "No zombies found"
else
ptree ${ZOMBIES} | more
fi
The output may ... | | More... 04/05/06 | | | | |
|
| | How to kill Unix user session
One way to kill all sessions for a specific user is to run the following command (replace username with the actual user name):
kill -9 `ps -u username | grep -v PID | awk '{ printf ("%s ", $1); }'`
Of course you should only use the -9 option when you really ... | |  More... 01/25/06 | | | | |
|
|
| | View the process tree on Unix
To see the process tree i.e. display all children of a process use ptree
This will show all processes and their children:
$ ptree
- or -
This will show tree for a specific process
$ ptree [process id] | |  More... 12/16/05 | | | | |
|
| | How to find all hard links to a file
Use find command to get a list of all hard links to a file.
1. Find out the inode number for the file
ls -asldi [filename]
2. Run find
find . -inum [inode number]
| | More... 12/12/05 | | | | |
|
|
|
|