LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   assign an arbitrary name or letter to a directory (https://www.linuxquestions.org/questions/linux-general-1/assign-an-arbitrary-name-or-letter-to-a-directory-365591/)

Melsync 09-21-2005 09:36 AM

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

druuna 09-21-2005 09:44 AM

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.

Melsync 09-22-2005 07:57 AM

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!

ioerror 10-06-2005 09:48 AM

Use a symlink:

ln -s ~/terrible/example ~/M


All times are GMT -5. The time now is 05:34 PM.