HP-UX System Administrator's Guide: Routine Management Tasks

Moving a Directory (within a File System)
From time to time, a user needs to move a directory, say from /home/user to
/work/project5. The following may be helpful as a cookbook.
1. cp -r /home/user/subdir /work/project5/subdir
Do not create /work/project5/subdir first.
2. ll -R /home/user/subdir
3. ll -R /work/project5/subdir
4. Compare the output of the last two commands; if they match, proceed to the next
step.
5. rm -r /home/user/subdir
6. Change permissions if necessary.
The above operation should leave the ownership intact, but if you have to invoke
the root user for some reason, the new files will all be owned by root. There is an
elegant way to change permissions throughout a subtree:
cd /work/project5/subdir
find . -print | xargs chgrp usergroup
find . -print | xargs chown user
Popping the Directory Stack
You can avoid retyping long path names when moving back and forth between
directories by using the hyphen (-) to indicate the last directory you were in; for
example:
$pwd/home/patrick$cd /projects$cd -/home/patrick
Continuing to Work During a Scheduled Downtime
If your file server is down and you share files from that system, those files are
inaccessible to you. If you are able to use your system and the necessary software is
available, copy the data files into your local directory tree and work on them there
while the file server is down. You can also copy any other files or executables you need.
It is very important that you copy any modified files back to the appropriate location
on the file server as soon as it is available again.
Also, while the file server is down, do not save files in the shared directory or any other
mount point. Such files will be hidden when you remount the file system from the file
server.
Diagramming a System’s Disk Usage
It’s useful (and in some circumstances essential) to have a hardcopy diagram of a
system’s disks and how they are used. You should create such a diagram at least for
How To: 151