tar extract
Use tar extract to extract files and folders.
Syntax
tar extract archive-file fileurl-dest [ verbose ] [ screen | to directory-name ]
Views
User view
Predefined user roles
network-admin
mdc-admin
Parameters
archive-file fileurl-dest: Specifies the archive file name. The suffix can be .tar or .tar.gz.
verbose: Displays the names of the successfully extracted files and folders.
screen: Displays the content of the extracted files and folders on the screen. The extracted files are not saved.
to directory-name: Saves the extracted files and folders to a path.
Usage guidelines
If you do not specify the screen keyword or the to directory-name option, the command extracts the archived files and folders and saves them to the same folder as the archive file.
Examples
# Extract files and folders, and save them to the same folder as the archive file.
<Sysname> tar extract archive-file a.tar.gz Extracting archive a.tar.gz …… Done.
# Extract files and folders, and display their content on the screen.
<Sysname> tar extract archive-file a.tar.gz verbose screen a.cfg # version 7.1.045, Ess 2106 # sysname Sysname #
# Extract files and folders, save them to the same folder as the archive file, and display the names of the archived files and folders.
<Sysname> tar extract archive-file a.tar.gz verbose a.txt
# Extract files and folders, and save them to the path flash:/a.
<Sysname> tar extract archive-file a.tar.gz to flash:/a Extracting archive a.tar.gz ......Done.
Related commands
tar create
tar list