How to Preserve Symbolic Links in Tar Command

Channel: Linux
Abstract: How to preserve symbolic links (symlinks) especially when you tar the files is explained below. We all know how to use tar command. The below option s

How to preserve symbolic links (symlinks) especially when you tar the files is explained below. We all know how to use tar command. The below option shows the way to preserve links when you archive.

Example:

# tar -cvhf archive.tar /backupfolder

Note: What you need to remember is that when tar archives a symbolic link, it writes a record to the archive naming the target of the link. When you use -h with -c, it causes tar to archive the files symbolic links point to, instead of the linking themselves. When this option is used, when tar encounters a symbolic link, it will archive the linked-to file, instead of simply recording the presence of a symbolic link.

How to unzip zip files in Linux

To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video

How to unzip zip files in Linux Read Also:
  • How to Create Symbolic Link for Files and Folders in Linux
  • How to Remove Symbolic Link in Linux with Example

Ref From: linoxide
Channels:

Related articles