Soft and hard connections

First, the difference between soft connection and hard connection
      First, the ln command keeps every linked file in sync, that is, no matter where you change it, the other files will have the same changes.

     Second, the ln link is divided into two types: soft link and hard link. Soft link is ln –s source file target file, it will only generate a mirror image of a file in the location you selected, and will not occupy disk space. Link ln source file object file, without parameter -s, it will generate a file of the same size as the source file at the location you selected, whether it is a soft link or a hard link, the file will keep changing synchronously.

 

Second, the application example

     #Establish a soft connection ln -s source path target path (similar to the shortcut of the windows system)

    ln -s /home/local/memcached/lib/libevent-1.2.so.1 /usr/lib64/libevent-1.2.so.1
    #Create a hard link ln source path target path
    ln  /home/local/memcached/lib/libevent-1.2.so.1  /usr/lib64/libevent-1.2.so.1

 

     

    

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326800702&siteId=291194637