Next: Links
Up: No Title
Previous: File Directory Structures
Operations that can be performed on a directory include :
- Open/Close a directory
- find a file in directory using a pattern (wildcards etc)
- Create/Delete : how do we deal with non-empty directories ?
- Link/Unlink : An indirection across directory structure
- Change directories : Move across directory structures
- List : files present within a directory
- Attributes : Read attributes of a file or change them (protection information) -
in Unix - the sticky bit
Need to traverse directory structure for archiving (backups), a useful command in
unix :
find . -name 'something_nice' -print
or something more complex :
Remove all files in your home directory named a.out or * .o
that have not been accessed for a week:
my_prompt% find $HOME \( -name a.out -o -name '*.o' \
-atime +7 \ -exec rm {} \;
Omer F Rana
Sat Feb 15 19:06:41 GMT 1997