Though it happens, it is relatively rare to use the ln command without the -s option, even for hard-core geeks. The ln command can make other types of links besides symbolic links, so it's important to remember to feed it the -s option to let it know that you want to create a symbolic link. To make a link that shows up on my desktop, I open up Konsole and run the following command: -s /home/jonesy/public_html/websites/testing/site1/home/jonesy/Desktop/site1Īgain, remember to change jonesy in the above command to your own login name. Note that we can call the target whatever we want. We call the symlink itself the target, and it points to the source we just created. The -p option tells mkdir to create any parent directories along the way that don't already exist. The mkdir command creates a directory anywhere you have permission to do so. Remember to change jonesy to your own login name.Īgain, we've just created the source directory. Follow along at home: mkdir -p /home/jonesy/public_html/websites/testing/site1 In this scenario, we call /home/jonesy/public_html/websites/testing/site1 the source directory, and I create that directory using the mkdir command. It also would be nice to be able to drag files to the folder without having to browse to it first. I need to have quick access to this directory on a pretty regular basis, so it would be nice to have a shortcut on my desktop so I can get to it in a single click. Suppose I'm working on a Web site, and I want all of the Web site files to be located in /home/jonesy/public_html/websites/testing/site1. However, for the impatient, the command line allows you to do the job with less clicking around. Of course, the world of pretty graphics and windows provides ways of creating symlinks. They are so named because, like shortcuts, a symlink is really just a symbolic placeholder or link to the file or directory you're trying to get at. In the Linux world, shortcuts do exist, but they're generally referred to as symbolic links, or symlinks. If you come from the world of Windows, you undoubtedly understand the concept of a shortcut.
0 Comments
Leave a Reply. |