shortcuts


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers shortcuts
# 1  
Old 08-02-2006
shortcuts

Hi,

I'm new to this forum, but i'm getting to work on some unix and i like it a lot. I'm trying to figure out a way i can create a shortcut command for a long pathname for example, if i needed to access a file in a particular directory i would type "cd /sampledata/IFS/IFS_DEV/HDC/files/glitter". but instead i just want to type "glitter" at the command line and be able to access the glitter directory. Can someone give me a sample script that would help me accomplish this.

Thanks for your help
# 2  
Old 08-02-2006
man the alias command.
# 3  
Old 08-03-2006
shortcuts

yes, but i think that just gives it an assigns it a name. It does not actually execute the command from one directory and take me to that location as specified by the actual path name
# 4  
Old 08-03-2006
Solution to shortcuts

Well, u can use alias to give that long path any aliasname.
Then after that use "cd aliasname" at ur shell.
This will work.
Just try it!!

For making alias name effective for all ur future sessions....
Edit .profile file and enter that alias command there.....
# 5  
Old 08-03-2006
1) find in your root directory the following file
.cshrc or .cshrc.user(hidden files)
2) in this file add the following line.
alias glitter 'cd /sampledata/IFS/IFS_DEV/HDC/files/glitter')
# 6  
Old 08-03-2006
shortcuts

[sd12@phenix sd12]$ cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
unset USERNAME

alias disk 'cd /sam/dir1/disk'

This is the alias script i used. but i get an error message when i type disk at the command line. it is not taking me to that the file disk.

[sd12@phenix sd12]$ disk
bash: disk: command not found

Also i get this error message when i log in

bash: alias: disk: not found
bash: alias: cd /sam/dir1/disk: not found

Can someone please enlighten. Thank you
# 7  
Old 08-03-2006
if you're modifying '.profile':
Code:
alias disk='cd /sam/dir1/disk'

alias definitions for different shells are different - you had syntax for csh-types shells and you're runnig bash-like shell.

and don't forget to 'source' your '.profile' file after modifying it:
Code:
. ~/.profile

 
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. Ubuntu

Problem creating Desktop shortcuts through Debian dpkg installer scripts

Hi, I am creating a debian package (*.deb) for my application using the command I am using debian pre/post installer scripts to do certain tasks before/after installation/uninstallation. One such task is to create a shortcut on the user's desktop to launch my application. I am trying to do this... (0 Replies)
Discussion started by: royalibrahim
0 Replies

2. UNIX for Dummies Questions & Answers

How to change Firefox keyboard shortcuts

Hi board! Can anybody tell me how to configure the Keyboard shortcuts of Firefox? I know that there is an extension called keyconfig and I used it with Firefox 1.0 but I it wasn't updated since 2005 or something. I also had a closer look at about:config but didn't find anything. My Google... (7 Replies)
Discussion started by: schallstrom
7 Replies

3. Shell Programming and Scripting

GVIM keyboard shortcuts

Hi all, I am new to linux, can anybody send any link for "GVIM" keyboard shortcuts. (1 Reply)
Discussion started by: balaramaiah.t
1 Replies

4. UNIX for Dummies Questions & Answers

Linking Files in UNIX (shortcuts)

Hello, Can anyone tell me how I can make a file link or shortcut in UNIX 4.0, several file links where damaged during an outage examples below. Examples: file -> file libX11.so -> /usr/shlib/libX11.so.pre.O3D All of the file links that were damaged were in /shlib and point to... (3 Replies)
Discussion started by: jays337
3 Replies
Login or Register to Ask a Question