Create shortcut to a directory in unix


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Create shortcut to a directory in unix
# 1  
Old 08-25-2009
Create shortcut to a directory in unix

Hello,

I am having a problem to create a shortcut in a directory linked to another directory in my home directory. For example, I would like to create a shortcut 'outputs', which directly links to the real 'outputs' in my home directory. So, I was wondering if ln is the correct command in this case, or which command shall I use. Thank you so much!
# 2  
Old 08-25-2009
The word "shortcut" is a Window-ism. You'd normally use "ln -s" to create a (symbolic, or soft) link.

It's hard to tell from your description, where the "problem" is.

Can you be more descriptive?

Code:
cd
ln -s some_dir/another_dir/outputs outputs

# 3  
Old 08-25-2009
Yes, I specify my question more here.

I am running a program which generates outputs in my home directory (1). However, in order to access conveniently to the output files, I need to create a 'shortcut' in my project's directory so I do not have to cd back and forth.

(1): ~/outputs/
(2): ~/project/Space/

To do that, I made the 'outputs' in my home directory and I tried 'ln -s ~/outputs ~/project/Space' but it gave me a symbolic link that fails to access to the outputs in my home directory. Please help, thank you so much!!!
# 4  
Old 08-25-2009
To create a symbolic link from ~/project/Space/outputs to ~/outputs, you could use:
Code:
ln -s ../../outputs ~/project/Space/outputs

-or-
Code:
ln -s ~/outputs ~/project/Space/outputs


Last edited by Scrutinizer; 08-25-2009 at 05:06 PM..
# 5  
Old 08-25-2009
So, you have a directory (not a link) in your home directory called "outputs"

You have a directory off your home directory called "project/Space"

Inside project/Space you have a link called "outputs".

Show me:
Code:
ls -ld ~/outputs
 
ls -ld ~/project/Space
 
ls -l ~/project/Space

# 6  
Old 08-25-2009
Thank you for your time, guys. The problem is resolved.

I used the following codes to do that:

"ln -s ../../outputs ~/project/Space" (Scrutinizer) then
"ls -ld outputs" (scottn)

Thanks again =)
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script cannot create directory and move the file to that directory

I have a script, which is checking if file exists and move it to another directory if then mkdir -p ${LOCL_FILES_DIR}/cool_${Today}/monthly mv report_manual_alloc_rpt_A_I_ASSIGNMENT.${Today}*.csv ${LOCL_FILES_DIR}/cool_${Today}/monthly ... (9 Replies)
Discussion started by: digioleg54
9 Replies

2. Shell Programming and Scripting

How Create new directory and move files to that directory.?

Hi All, We have main directory called "head" under this we have several sub directories and under these directories we have sub directories. My requirement is I have to find the SQL files which are having the string "procedure" under "head" directory and sub directories as well. And create... (14 Replies)
Discussion started by: ROCK_PLSQL
14 Replies

3. Shell Programming and Scripting

List files with date, create directory, move to the created directory

Hi all, i have a folder, with tons of files containing as following, on /my/folder/jobs/ some_name_2016-01-17-22-38-58_some name_0_0.zip.done some_name_2016-01-17-22-40-30_some name_0_0.zip.done some_name_2016-01-17-22-48-50_some name_0_0.zip.done and these can be lots of similar files,... (6 Replies)
Discussion started by: charli1
6 Replies

4. Shell Programming and Scripting

Copy real file from a shortcut preserving the time stamps and directory tree

I have directory with shorcuts of files. for example: gara@yn\short\name1 ( shortcut to gara@yn\FOLDER\OPT\GARA\1.jpg ) gara@yn\short\name2 ( shortcut to gara@yn\FOLDER\OPT\GARA\11.jpg ) gara@yn\short\name3 ( shortcut to gara@yn\MARA\URSA\2.jpg ) gara@yn\short\name4 ( shortcut to... (6 Replies)
Discussion started by: gogok_bg
6 Replies

5. Solaris

How to create a shortcut for Openoffice?

Hello all, I am facing some problem after installing the Openoffice in Solaris 10. The installation is successful but i cannot find any icon or shortcut on both Application and Desktop... please help me on this.... (8 Replies)
Discussion started by: aungyepaing
8 Replies

6. Homework & Coursework Questions

Create script to add user and create directory

first off let me introduce myself. My name is Eric and I am new to linux, I am taking an advanced linux administration class and we are tasked with creating a script to add new users that anyone can run, has to check for the existence of a directory. if the directory does not exist then it has... (12 Replies)
Discussion started by: pbhound
12 Replies

7. UNIX for Advanced & Expert Users

unable to create any directory that uses numbers as the directory name

Version-Release number of selected component (if applicable): ================================================================== root@server # cat /etc/redhat-release Red Hat Enterprise Linux ES release 4 (Nahant Update 5) root@server # uname -a Linux server.integrityserver.net... (16 Replies)
Discussion started by: fed.linuxgossip
16 Replies

8. 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

9. UNIX for Dummies Questions & Answers

Shortcut to home directory?

Also, Wherever you are exploring files in the UNIX structure you can jusy type "cd". This will take you to your home directory. Hope that helps. Cheers! (4 Replies)
Discussion started by: guest100
4 Replies

10. UNIX for Dummies Questions & Answers

shortcut in unix?

Sorry, anybody here knows how to make a shortcut in unix? Thanks. Sebastian. (4 Replies)
Discussion started by: seba
4 Replies
Login or Register to Ask a Question