LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-21-2005, 09:36 AM   #1
Melsync
Member
 
Registered: Sep 2005
Posts: 75

Rep: Reputation: 15
assign an arbitrary name or letter to a directory


How can I tell my system that a precise folder, for instance, /home/user/terrible/example, will be called 'myexecs' or 'M' or whatever shortcut?
The idea is to call quickly the bash scripts and files of that folder:

$ ls -la myexecs

or

$ ls -ls M

instead of

$ ls -la ~/terrible/example

Thanks.
______

Fedora Core 3
 
Old 09-21-2005, 09:44 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

export M="/home/user/terrible/example"

ls -l $M

M is an exported (in case you want to use it in sub shells) variable that holds your dir, and can be used by placing a $ in front of it (see example above).

Put it in your .profile (or alike) to make it permanent.

Hope this helps.
 
Old 09-22-2005, 07:57 AM   #3
Melsync
Member
 
Registered: Sep 2005
Posts: 75

Original Poster
Rep: Reputation: 15
also files

Yes, I also wrote my export path at the /home/user/.bashrc file
export M=/home/user/terrible/example
and I could call $M after logging out and in.

I've tried with files, at they can be called everywhere with the $ symbol!.
Thanks!
 
Old 10-06-2005, 09:48 AM   #4
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 34
Use a symlink:

ln -s ~/terrible/example ~/M
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Arbitrary change of folder permssions apostate Mandriva 1 11-18-2005 12:34 AM
win98 assign home directory problem pmdav Linux - Newbie 4 01-12-2004 01:00 PM
Assign Drive Letter in Linux? UTKEngineer Linux - Newbie 3 10-28-2003 10:34 PM
Assign rights to directory robertmarkbram Linux - Newbie 4 08-15-2003 07:58 AM
How to assign directory access to a user linuxfans Linux - General 7 04-16-2003 12:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration