DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Automating frequent tasks

Shortening directory searches

Directory searching consumes a lot of time, especially in those applications that utilize deep directory structures and long pathnames. Judicious use of cd, the change directory command, can help shorten long pathnames and thus reduce the number of directory searches needed. For example, try the following commands:

time ls -l /usr/bin/* >/dev/null
time cd /usr/bin; ls -l * >/dev/null

The second command runs faster because of the fewer directory searches.


Next topic: Directory-search order and the PATH variable
Previous topic: Shortening data files

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003