Taming the tar command: Tips for managing backups in Linux To search for an image in .png format :Only.png files will be extracted from the.tar package with this method.In order to protect the shell from improperly expanding the wildcard (*), the –wildcards option instructs tar to interpret wildcards in the name of the files to be extracted, and the filename (*.png) is wrapped in single-quotes. Linux Examples. in Linux 6. Create a symlink to this dummy file. To expand a file in current directory: # bunzip2 file1.bz2. Above command will extract the files and directories from compressed archive file to /var/log directory. tar Always make sure that the directory into which you want to extract tar file exists. By now you should have a good understanding of how to use the Linux head command. Let’s assume we want to take backup of / home/linuxtechi, /etc and /opt folder. ; How to Download a File with wget #. unzip -t backup.zip. Example 1: Extracting tar Files to a Specific Directory. tar [[-]function] [options] -C directory-name... Command-line arguments that specify files to add to, extract from, or list from an archive can be given as shell pattern matching strings. Using --checkpoint-action without --checkpoint will assume the default checkpoint interval of 10 records.--delay-directory-restore: Delay setting modification times and permissions of extracted directories until extraction has … # echo "This is a test file" >> /root/test_file. In the following example we are moving file hello.txt from directory example to directory awesome. The line ‘syntax: regexp’ switches back. Create tar Archive File in Linux. Show all files of an archive: tar tvf archive.tar. Advertisement. rm Command Syntax rm OPTIONS FILES. tar For creating tar archive using tar command use below format. For example, the -a option, if added, will display the hidden files (which have their names started with a .