LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 09-08-2004, 09:58 AM   #1
Tantalos
LQ Newbie
 
Registered: Aug 2004
Posts: 6

Rep: Reputation: 0
Question alias for directories


How can I alias I folder,

alias test='ls -a -l' -> works
alias test='/home/Tantalos' -> this doesn't work

Is there a way to make aliases for folders?

Tantalos
 
Old 09-08-2004, 10:20 AM   #2
Charalambos
Member
 
Registered: Aug 2004
Location: Switzerland
Distribution: debian
Posts: 149

Rep: Reputation: 15
Alias is used to create an alias for a command, not for files or directories.
If you want something equal for files and directories, you should use symbolic links. You can achieve that with the command ln. E.g.
--> ln -s path/to/yourfile linkname
will create in the current directory a symbolic link named "linkname" to the specified file.

Last edited by Charalambos; 09-08-2004 at 10:21 AM.
 
Old 09-08-2004, 11:51 AM   #3
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
If you're interested in typing fewer characters, you could create an environment variable for a directory.
For example, on most distros, the variable $HOME is used to represent /home/username/.
If you have a directory you frequently work with, such as /usr/X11R6/lib/X11/fonts/ for example, you could do
export fontdir=/usr/X11R6/lib/X11/fonts

Then when you want to use this directory, do
command $fontdir
 
Old 09-14-2004, 12:34 PM   #4
kenji
Member
 
Registered: Sep 2004
Location: Philippines
Distribution: Red hat 9, Ubuntu 5.04, Free BSD 5.3, Knoppix 5.04, Ubuntu 8.04, [Slackware 12~13.1]
Posts: 141

Rep: Reputation: 16
try alias test='cd /home/Tantalos'
but why use alias why dont use links
instead or if you want to go to your
home folder try "cd" it would be
easier! 3

Last edited by kenji; 09-14-2004 at 12:49 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Alias question (2 commands for one alias) gflores Linux - Newbie 3 01-21-2006 12:40 AM
CHMOD directories.sub-directories.files zerojosh Linux - Software 2 11-19-2005 03:22 PM
Searching multiple directories and sub directories for a file jeep99899 Linux - Newbie 2 10-13-2005 12:23 PM
alias help jfauteux Linux - Software 3 04-08-2005 12:56 PM
IP Alias slacknut Slackware 9 03-31-2003 09:21 PM


All times are GMT -5. The time now is 02:01 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration