The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
512 Error while creating a directory shreyasjothish UNIX for Dummies Questions & Answers 11 04-17-2008 03:35 AM
Determining directory path cwalsek Shell Programming and Scripting 2 07-19-2007 06:04 AM
Truncate directory path here2learn Shell Programming and Scripting 4 01-26-2006 12:50 PM
ifconfig: difference between creating logical or alias network interface zaff IP Networking 5 11-22-2005 07:28 AM
Help with find command on a shortcut directory(Alias)??? swamy455 UNIX for Dummies Questions & Answers 2 07-07-2005 10:32 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 09-25-2006
Registered User
 

Join Date: Sep 2006
Posts: 9
Creating alias for directory path

I am trying to create an alias for a frequently used directory path by using

alias xyz="/proj/dir_name"

and then trying to reach a sub-directoy by using

cd xyz/abc

but I get an error saying " No such file or directory "

plz tell me wats wrong with this ...
Reply With Quote
Forum Sponsor
  #2  
Old 09-25-2006
Yogesh Sawant's Avatar
Part Time Moderator and Full Time Dad
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 798
Check the syntax of alias command.

It is similar to:
alias alias_name='some_command'

"/proj/dir_name" isn't a valid command, is it?
Reply With Quote
  #3  
Old 09-25-2006
Registered User
 

Join Date: Sep 2006
Posts: 9
Thanks a lot ... I got what I was doing wrong

finally i declared the path as a variable ... and then used

cd $<var>/<further directories>
Reply With Quote
  #4  
Old 09-25-2006
Ygor's Avatar
Moderator
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,249
Perhaps consider setting $CDPATH variable, e.g...
Code:
CDPATH='.:/proj/dir_name'
So now if you try...
Code:
cd xyz/abc
... you will cd to /proj/dir_name/xyz/abc
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 03:56 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0