home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / question / 15378 < prev    next >
Encoding:
Internet Message Format  |  1993-01-10  |  2.5 KB

  1. Path: sparky!uunet!autodesk!dansmith
  2. From: dansmith@Autodesk.COM (Daniel Louis Smith)
  3. Newsgroups: comp.unix.questions
  4. Subject: Re: looking a utility to chdir without typing full path
  5. Message-ID: <18350@autodesk.COM>
  6. Date: 10 Jan 93 06:56:45 GMT
  7. References: <1ikvt1INNqq2@usenet.INS.CWRU.Edu> <1993Jan9.005220.19993@cs.sandia.gov>
  8. Organization: Autodesk Inc., Sausalito CA, USA
  9. Lines: 47
  10.  
  11. In <1993Jan9.005220.19993@cs.sandia.gov> jhgreen@cs.sandia.gov (Jethro H. Greene) writes:
  12.  
  13. > In article <1ikvt1INNqq2@usenet.INS.CWRU.Edu> cl820@cleveland.Freenet.Edu (Wei Jin Mai) writes:
  14. > >
  15. > >    I just switch to Unix from Dos. Is there a utility or shell that let you
  16. > >change directory without typing full path? For example: chdir abc changes   
  17. > >working directory to /usr/local/src/abc .
  18. > >-- 
  19.  
  20. > "cd dir_name" should work.  Also, if you want to get fancy, play around with
  21. > the CDPATH.
  22.  
  23.     $cdpath is a good answer.  Here's a method to expand upon it
  24. and give yourself shortcuts to commonly visited directories...and without
  25. aliases or scripts!
  26.  
  27.     My cdpath:
  28.  
  29. #       where to find directories we're cd'ing to...
  30. set cdpath=(. ~ ~/.dirs  ~/{src,text} /usr{,/src,/local} /home .. ../.. )
  31.  
  32.     Note the "~/.dirs" directory.  Off of my home, I have
  33. this directory for the sole purpose of making symbolic links to places
  34. I go to frequently:
  35.  
  36. bermuda:dansmith/.dirs (1) :-) ll   [edited...]
  37. lrwxrwxrwx  1 root     daemon        12 Oct 22  1991 ubx -> /usr/bin/X11/
  38. lrwxrwxrwx  1 root     daemon        12 Oct 22  1991 ui -> /usr/include/
  39. lrwxrwxrwx  1 root     daemon        16 Oct 22  1991 uix -> /usr/include/X11/
  40. lrwxrwxrwx  1 root     daemon         8 Oct 22  1991 ul -> /usr/lib/
  41. lrwxrwxrwx  1 root     daemon        14 Oct 22  1991 ulb -> /usr/local/bin/
  42. lrwxrwxrwx  1 root     daemon        14 Oct 22  1991 ull -> /usr/local/lib/
  43. lrwxrwxrwx  1 root     daemon        14 Oct 22  1991 uls -> /usr/local/src/
  44. lrwxrwxrwx  1 root     daemon        18 Oct 22  1991 ulsx -> /usr/local/src/X11/
  45. lrwxrwxrwx  1 root     daemon        12 Oct 22  1991 ulx -> /usr/lib/X11/
  46. lrwxrwxrwx  1 root     daemon        15 Oct 22  1991 usn -> /usr/spool/news
  47. lrwxrwxrwx  1 root     daemon        15 Oct 22  1991 usu -> /usr/spool/uucp/
  48. bermuda:dansmith/.dirs (1) :-) 
  49.  
  50.     ...so I can "cd ulb" and be in /usr/local/bin.  Just think of
  51. the ~/.dirs (or whatever you wnat to call it) as "jump off" point
  52. that can take you anywhere in the filesystem.
  53.  
  54.                     Daniel
  55. -- 
  56.  dansmith@autodesk.com       daniel@world.std.com       dansmith@well.sf.ca.us
  57.         Daniel Smith, Autodesk, Sausalito, California, (415) 332-2344 x 2580
  58.