Jump to content

Recommended Posts

Posted

I have uploaded all my files through Frontpage. When I look at the listed files with either my ftp program, or through the file manager on Cpanel, they show in both the www folder and the public_html folder. If the www folder is a shortcut to public_html, does that mean that I have duplicate files since both show? Should I delete the files in www and just leave the public_html files?

Posted

Nope--you don't really have duplicates of everything.

If you look at file/directory sizes, you'll notice that the "www" is just a few bytes--think of it as a "shortcut" to the public_html folder--that's why everything is shown in there--it's really just displaying the contents of public_html

Posted

the www/ directory is really something called a "link".

 

if you have SSH, you can see that the directory permissions are different.

 

>drwxrwxrwx   14 usernm  usernm      4096 Apr 28 19:45 public_html
lrwxrwxrwx    1 usernm  usernm        11 Feb 16 20:36 www -> public_html

 

like jimzdat said, its just like a shortcut. also realize that, like w/ links and shortcuts, if you move the target, the link to the target becomes useless. so be cautious when deleting...

 

if you want a technical answer, check this out, which i found on google....

 

In Unix, what is a symbolic link, and how do I create one?

A symbolic link, also termed a soft link, is a special kind of file that points to another file, much like a shortcut in Windows or a Macintosh alias. Unlike a hard link, a symbolic link does not contain the data in the target file. It simply points to another entry somewhere in the file system. This difference gives symbolic links certain qualities that hard links do not have, such as the ability to link to directories, or to files on remote computers networked through NFS. Also, when you delete a target file, symbolic links to that file become unusable, whereas hard links preserve the contents of the file.

 

To create a symbolic link in Unix, at the Unix prompt, enter the following command:

 

  ln -s source_file myfile

 

Replace source_file with the name of the existing file for which you want to create the symbolic link (this file can be any existing file or directory across the file systems). Replace myfile with the name of the symbolic link. The ln command then creates the symbolic link. After you've made the symbolic link, you can perform an operation on or execute myfile, just as you could with the source_file. You can use normal file management commands (e.g., cp, rm) on the symbolic link.

 

Note: If you delete the source file or move it to a different location, your symbolic file will not function properly. You should either delete or move it. If you try to use it for other purposes (e.g., if you try to edit or execute it), the system will send a "file nonexistent" message.

 

To find out more about symbolic links, you can view the man pages for the ln command. To do this, at the Unix prompt, enter the following command:

 

  man ln

Posted

An easy way to get your arms (and brains) around this, IMO ... is to consider the www/ directory like a mirror -- it is simply mirroring (reflecting) the contents of the public_html directory.

 

When you look at yourself in the mirror, you see two of you, but there's really only one!

 

Same thing here --- you "see" two sets of files (one in the public_html directory, and one in the www directory), but there's really only one set of files!

 

-kw

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...