The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
please help me regarding alias naree Shell Programming and Scripting 17 06-03-2008 05:14 AM
How to get the alias,when we have the IP. preethgideon UNIX for Dummies Questions & Answers 2 07-24-2007 03:53 PM
alias help shafique UNIX for Dummies Questions & Answers 5 10-03-2006 01:56 PM
alias klannon Filesystems, Disks and Memory 6 04-27-2006 09:36 AM
Alias guelpth UNIX for Dummies Questions & Answers 2 02-17-2005 07:29 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-12-2005
DebianJ DebianJ is offline
Registered User
  
 

Join Date: May 2005
Posts: 52
using alias...

hi..

i want to make an alias in unix, for using it to change of directory
by example:

if i am in /dtmp/inp/aux and i want to go to /sybase/bd, i want to make an alias named "bd", to go directally to /sybase/bd (alias bd="cd /sybase/bd")


i create it, but when i turn off the conection the alias doesn´t exists for the next connnection.

it is possible make an alias for ever? or is there another solution to my problem?

jona
  #2 (permalink)  
Old 05-12-2005
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,246
you need to put the alias into your profile for it to be loaded each time for ksh add it to .kshrc for bash .bashrc`in your home directory.
  #3 (permalink)  
Old 05-12-2005
Ygor's Avatar
Ygor Ygor is offline Forum Staff  
Moderator
  
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,409
To navigate to frequently-used directories, I have the following line in my .profile…

alias ycd='select ID in $(<$HOME/.ycd_list);do [ $ID ] && cd $ID;break;done'

… and I maintain a list of directories in $HOME/.ycd_list

Use it like this…

$ ycd
1) /very/long/path/to/some/working/directory
2) /extremely/long/path/name
3) /etc/you/get/the/idea
#? 2 <<-- note: I keyed 2 here, use 0 or q to quit
$ pwd
/extremely/long/path/name

Note that it only works with ksh-based shells which have a select function. Take a look and the manual pages for a proper description of select and the PS3 prompt.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:23 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0