• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            linux&c++ R&D

            programing is a pleasure!

            a shortcut for linux( from linux journal )

            f you come from the world of Windows, you undoubtedly understand the concept of a shortcut. In the Linux world, shortcuts do exist, but they're generally referred to as symbolic links, or 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.

            Of course, the world of pretty graphics and windows provides ways of creating symlinks. However, for the impatient, the command line allows you to do the job with less clicking around. Let's have a look at an example.

            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. 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. It also would be nice to be able to drag files to the folder without having to browse to it first.

            In this scenario, we call /home/jonesy/public_html/websites/testing/site1 the source directory, and I create that directory using the mkdir command. Follow along at home:

            mkdir -p /home/jonesy/public_html/websites/testing/site1

            Remember to change jonesy to your own login name.

            Again, we've just created the source directory. The mkdir command creates a directory anywhere you have permission to do so. The -p option tells mkdir to create any parent directories along the way that don't already exist.

            We call the symlink itself the target, and it points to the source we just created. Note that we can call the target whatever we want. In this case, I just call it site1. To make a link that shows up on my desktop, I open up Konsole and run the following command:

            @cx:ln -s /home/jonesy/public_html/websites/testing/site1<\n>/home/jonesy/Desktop/site1

            Again, remember to change jonesy in the above command to your own login name.

            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. Though it happens, it is relatively rare to use the ln command without the -s option, even for hard-core geeks.

            For Aspiring Geeks
            If you forget the -s option, you'll create what's called a hard link. Though the differences are subtle, they are significant. Depending on the location of the link in relationship to the source, you can generate an error, because hard links cannot cross drive partition boundaries. In the guts of the system, the plain facts are that a hard link is actually just another alternative name for the same bunch of data stored somewhere on the disk (in technical terms, the hard link and the original file would point to the same inode).

            But Wait! There's More!

            Of course, making a link to a particular file is exactly like making a link to a directory. So, if I want to make a link to my favorite photo (/home/jonesy/Photos/mypic.jpg) on my desktop, I can do it like this:

            ln -s /home/jonesy/Photos/mypic.jpg /home/jonesy/Desktop/

            I threw in a little trick in the above command. Because I didn<\#213>t want the symlink to have a different name from the file it points to, I simply use a . (period), which is shorthand for saying, don't change the name.

            For more information about the ln command, try running

            man ln

            , which is the manual or man page for the ln command.

            About the Author

            Brian Jones is a system/network/database administrator and sometime Web developer for the Computer Science Department at Princeton University. He is also a freelance writer and editor, spending most of his freelance time writing about technology for various Web and print publications. In his free time, he enjoys brewing beer, home recording and playing billiards.

            posted on 2008-03-25 19:21 丑石 閱讀(613) 評(píng)論(0)  編輯 收藏 引用 所屬分類: My life

            My Links

            Blog Stats

            News

            常用鏈接

            留言簿(1)

            隨筆分類(13)

            隨筆檔案(17)

            文章檔案(1)

            相冊

            收藏夾(1)

            Friends' blog

            useful sites

            搜索

            積分與排名

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            久久99精品九九九久久婷婷| 久久无码人妻精品一区二区三区 | 久久亚洲精品无码aⅴ大香 | 久久精品国产99国产精品亚洲| 日本亚洲色大成网站WWW久久| 狠狠色丁香久久婷婷综合蜜芽五月| 亚洲日韩欧美一区久久久久我| 久久精品中文无码资源站| 精品国产乱码久久久久久郑州公司 | 亚洲欧美日韩久久精品第一区| 久久精品亚洲日本波多野结衣| 国产精品99久久久久久猫咪 | 看全色黄大色大片免费久久久 | 欧美一区二区久久精品| 99re这里只有精品热久久 | 亚洲中文字幕无码久久综合网| 久久久一本精品99久久精品88| 久久影院亚洲一区| 亚洲一本综合久久| 久久亚洲精品中文字幕| 伊人久久成人成综合网222| 久久99精品国产一区二区三区| 久久精品国产亚洲av麻豆图片| 亚洲国产精品人久久| 午夜久久久久久禁播电影| 久久精品国产精品亚洲艾草网美妙| 一本久久a久久精品vr综合| 亚洲国产婷婷香蕉久久久久久| 九九久久精品国产| 亚洲中文字幕无码久久2017| 亚洲午夜精品久久久久久浪潮| 91精品观看91久久久久久| 久久国产乱子精品免费女| 久久夜色精品国产网站| 无码国内精品久久综合88| 亚洲精品成人久久久| 亚洲国产高清精品线久久 | 久久99精品国产麻豆蜜芽| 国产福利电影一区二区三区久久老子无码午夜伦不| 精品久久久久久中文字幕大豆网| 久久精品国产日本波多野结衣|