Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-03-2006, 01:36 PM   #1
Registered: Nov 2005
Distribution: CentOS
Posts: 154

Rep: Reputation: 15
symlinks from folders to folders?

Is there a way to create a symlink (or any other method) that points an empty folder in one location to a folder somewhere else on the same file system?
Basically, a symlink, only from folder to folder vs. file to target.

Thanks to all.
Old 04-03-2006, 01:43 PM   #2
Senior Member
Registered: Oct 2004
Location: Luxemburg
Distribution: Slackware, OS X
Posts: 1,507

Rep: Reputation: 46
I cannot see the difference between the 2 cases you mention:

pu@slackw:~/temp$ mkdir folder1
pu@slackw:~/temp$ v
total 0
drwxr-xr-x  2 pu pu 48 2006-04-03 20:41 folder1/
pu@slackw:~/temp$ ln -s folder1 folder2
pu@slackw:~/temp$ cd folder1
pu@slackw:~/temp/folder1$ touch afile
pu@slackw:~/temp/folder1$ cd ..
pu@slackw:~/temp$ v folder2/*
-rw-r--r--  1 pu pu 0 2006-04-03 20:41 folder2/afile
Old 04-03-2006, 01:43 PM   #3
Registered: Nov 2004
Location: Florida, USA
Distribution: Debian, Redhat
Posts: 416

Rep: Reputation: 53
Sure. Just use ln -s <destination folder> <name of symlink>
Old 04-03-2006, 01:48 PM   #4
Registered: Nov 2005
Distribution: CentOS
Posts: 154

Original Poster
Rep: Reputation: 15
Thanks to you both. I did not realize it would work for folders. I thought the symlink would appear as a file that points to a folder. It worked great!

Thanks for the fast response.
Old 04-03-2006, 01:51 PM   #5
LQ Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 272Reputation: 272Reputation: 272
In linux, everything is a file, including hardware and directories.


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
Samba can create new files and folders but access denied in any new folders k.king Linux - Networking 2 01-15-2006 06:14 AM
folders qerf Linux - Newbie 1 11-19-2005 09:20 PM
What are those folders? Ephracis LQ Suggestions & Feedback 2 02-25-2005 08:34 AM
So many folders merchtemeagle Linux - Newbie 4 10-07-2004 08:23 AM
what are those folders in a / jpkeisala Linux - Newbie 6 04-18-2004 01:16 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:14 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration