LinuxQuestions.org
Visit Jeremy's Blog.
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 07-20-2009, 09:44 AM   #1
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,685

Rep: Reputation: 48
Making a Symbolic link to a directory on another partition


I want to create a symbolic link inside of /data2/storage called MyPictures to my pictures folder which is actually /data1/pictures.

How do i do that?

ln -s /data1/pictures /data/storage/MyPictures

is that right? I don't want to do something wrong and lose all my pictures.
 
Old 07-20-2009, 09:52 AM   #2
Agrouf
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

Rep: Reputation: 79
right!
 
Old 07-20-2009, 09:52 AM   #3
monsm
Member
 
Registered: Feb 2005
Location: London, UK
Distribution: Gentoo
Posts: 568

Rep: Reputation: 37
That sounds right. You can doublecheck the man pages.

You won't delete anything with that command. It might put the symbolic link in the wrong directory, but you won't loose anything. Just be careful when you delete a symbolic link, so that you don't delete the real directory.

Mons
 
Old 07-20-2009, 09:58 AM   #4
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,685

Original Poster
Rep: Reputation: 48
is that what happens when you delete a symbolic link, it deletes the source folder too?
 
Old 07-20-2009, 10:09 AM   #5
nuwen52
Member
 
Registered: Feb 2009
Distribution: Debian, CentOS 5, Gentoo, FreeBSD, Fedora, Mint, Slackware64
Posts: 208

Rep: Reputation: 46
ln is basically,
ln -s <source directory or file> <destination>

Basically, the same as cp.

Also. If you delete the link, it should not touch the actual directory/file or contents. And, by that, I mean if you just use a simple rm from the command line. No -rf or anything funny like that. I think what monsm meant was don't delete the actual directory by mistake.

Last edited by nuwen52; 07-20-2009 at 10:10 AM.
 
Old 07-20-2009, 10:10 AM   #6
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,685

Original Poster
Rep: Reputation: 48
Thanks everybody, I'm all set now.
 
  


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
Cannot remove symbolic link to directory. martint Linux - Newbie 6 09-17-2014 08:45 PM
Making Symbolic link? Frank Soranno Debian 6 01-10-2007 11:26 AM
How to check if a parent directory is a symbolic link compnovice Linux - Newbie 11 10-06-2005 05:59 PM
help making symbolic link mykrob Linux - Software 9 09-11-2004 09:43 PM
directory symbolic link resolution rusti999 Linux - Software 6 08-09-2004 04:13 PM


All times are GMT -5. The time now is 06:48 AM.

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