Define Alias for Changing Directory to Another One


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Define Alias for Changing Directory to Another One
# 1  
Old 10-29-2011
Define Alias for Changing Directory to Another One

Hello Friends is it possible to define an alias (say named as COMMAND) to pick a part of line and change my directory to picked. For example

when I type
COMMAND mfong@vhl.gov.nd/homefolder/hhk/ADS/

it would do
cd /homefolder/hhk/ADS/

# 2  
Old 10-29-2011
Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.


Proceed here:

https://www.unix.com/shell-programmin...-variable.html
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Changing file extension in csh alias

I want to type only the filename of a gcc source that has ".syn" as an extension and copy it, changing the extension to ".c" so it can be compiled. I do it as follows: if (-e $1.syn) then /bin/cp $1.syn $1.c endif This works fine, but if I want to repeat the compilation by... (1 Reply)
Discussion started by: ygmwayne
1 Replies

2. UNIX for Dummies Questions & Answers

alias to go back to previous directory?

Some time ago I was using a linux system and someone had set up and alias called "back" that got me back to the directory I was last in, which was very useful. I've now switched to using a mac, and don't have those aliases available. Can anyone tell me how I could make a an alias that would... (2 Replies)
Discussion started by: ac2011
2 Replies

3. Shell Programming and Scripting

Changing the sender Email address to Alias

Hi All, I want to change the email address of the sender to some alias for eg: FROM:noreplyecommerce@test.com needs to be changes to TEST Please help me. (3 Replies)
Discussion started by: sithara
3 Replies

4. UNIX for Dummies Questions & Answers

Create alias to daily dated directory

Hello, I wanted to see if there's a way to shortcut to a dated logs directory that changes daily...what I'm working with is something like this: > > > . . where the log directory is named yyyymmdd I've created a shortcut to get me to the /log directory but was... (2 Replies)
Discussion started by: mojowtm6
2 Replies

5. Shell Programming and Scripting

alias to cd and ls a directory

I am trying to create an alias to cd to a directry and ls the directory I have changed to. I have the following code; alias cd= 'cd ; ls $@' This just cd to the directory and ls the current directory. Any suggestions? Thanks (10 Replies)
Discussion started by: cold_Que
10 Replies

6. UNIX for Dummies Questions & Answers

Changing windows server alias name on windows or unix?

My situation is that we have production unix scripts that ftp files over to a windows server. I'm not sure if its a 2000 or 2003 server as I dont work on server, more on the unix side. It turns out that they are changing servers on the network. So they are migrating our data over from say Server 1... (1 Reply)
Discussion started by: NycUnxer
1 Replies

7. Shell Programming and Scripting

Define an alias with an embeded awk command ??

Hi all, I'm trying to define an alias with an embeded awk command: alias kpipe='kill `psme| grep "ifw -r" | grep -v "grep ifw -r"| awk '{print $2}'`' The problem is that the awk command (awk '{print $2}') contains two ' ..' quotes. So bash assumes that the first awk quote corresponds to... (5 Replies)
Discussion started by: jfortes
5 Replies

8. UNIX for Dummies Questions & Answers

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 ... (3 Replies)
Discussion started by: jasjot31
3 Replies

9. UNIX for Dummies Questions & Answers

Help with find command on a shortcut directory(Alias)???

Hi All, I am trying to find some files on a directory( /usr/users/xyz/log) which is an alias to another directory(/spare/log). My find works fine on /spare/log but it doesnt return anything when i use it on /usr/users/xyz/log. Any Ideas on how to proceed. Thanks in advance. Swamy (2 Replies)
Discussion started by: swamy455
2 Replies

10. Programming

changing directory on server

hi, I'm doing to some simple socket programming. I have a client that connects to the server and request stuff. For example, if the client type in "ls", that command will be sent to the server and the server will send back the ls information the client requested. Similarly, if the client type... (1 Reply)
Discussion started by: bb00y
1 Replies
Login or Register to Ask a Question