$ whatis tar
$ whatis gzip
$ whatis gunzip
$ whatis zcat
tar (1) - an archiving utility
gzip (1) - compress or expand files
gunzip (1) - compress or expand files
zcat (1) - compress or expand files
Description: To get a list of all the files in the current directory you type:
$ ls -l
total 220
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rw-rw-r-- 1 wahid wahid 0 May 3 15:12 tar-gzip-gunzip-info.txt
Description: To get the disk usage of all files in the current directory you type:
$ du -sh *
136K fallocate-info.txt
80K figlet-info.txt
4.0K myxterm.sh
0 tar-gzip-gunzip-info.txt
Description: To find out the 'Type' of files in the current directory you type:
$ file *
fallocate-info.txt: UTF-8 Unicode text, with very long lines, with CRLF, CR, LF line terminators, with escape sequences, with overstriking
figlet-info.txt: UTF-8 Unicode text, with very long lines, with CRLF, CR, LF line terminators, with escape sequences, with overstriking
myxterm.sh: Bourne-Again shell script, ASCII text executable
tar-gzip-gunzip-info.txt: empty
Description: To make a backup copy of the file below you type:
$ cp myxterm.sh myxterm.sh.bak
$ ls -l
total 224
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 0 May 3 15:12 tar-gzip-gunzip-info.txt
Description: To get the manual page of the command gzip and send the output to the file gzip.manpage:
$ man gzip > gzip.manpage
$ ls -l
total 244
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 0 May 3 15:12 tar-gzip-gunzip-info.txt
$ file *.manpage
gzip.manpage: UTF-8 Unicode text
$ tail gzip.manpage
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived
work is distributed under the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this
permission notice may be stated in a translation approved by the Foundation.
local GZIP(1)
$ head gzip.manpage
GZIP(1) General Commands Manual GZIP(1)
NAME
gzip, gunzip, zcat - compress or expand files
SYNOPSIS
gzip [ -acdfhklLnNrtvV19 ] [--rsyncable] [-S suffix] [ name ... ]
gunzip [ -acfhklLnNrtvV ] [-S suffix] [ name ... ]
zcat [ -fhLV ] [ name ... ]
$ man -k tar
bdflush (2) - start, flush, or tune buffer-dirty-flush daemon
byobu-disable (1) - wrapper script for enabling/disabling automatic startup of byobu after login into text console
byobu-enable (1) - wrapper script for enabling/disabling automatic startup of byobu after login into text console
cryptdisks_start (8) - wrapper around cryptsetup that parses /etc/crypttab.
dbus-run-session (1) - start a process as a new D-Bus session
docker-container-export (1) - Export a container's filesystem as a tar archive
docker-container-restart (1) - Restart one or more containers
docker-container-start (1) - Start one or more stopped containers
docker-context-export (1) - Export a context to a tar or kubeconfig file
docker-context-import (1) - Import a context from a tar or zip file
docker-export (1) - Export a container's filesystem as a tar archive
docker-image-import (1) - Import the contents from a tarball to create a filesystem image
docker-image-load (1) - Load an image from a tar archive or STDIN
docker-image-save (1) - Save one or more images to a tar archive (streamed to STDOUT by default)
docker-image-tag (1) - Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
docker-import (1) - Import the contents from a tarball to create a filesystem image
docker-load (1) - Load an image from a tar archive or STDIN
docker-restart (1) - Restart one or more containers
docker-save (1) - Save one or more images to a tar archive (streamed to STDOUT by default)
docker-start (1) - Start one or more stopped containers
docker-tag (1) - Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
erfc (3) - complementary error function
erfcf (3) - complementary error function
erfcl (3) - complementary error function
Exporter::Tiny::Manual::QuickStart (3pm) - the quickest way to get up and running with Exporter::Tiny
fcgistarter (8) - Start a FastCGI program
genisoimagerc (5) - startup configuration file for genisoimage
getgroups (2) - get/set list of supplementary group IDs
getgroups32 (2) - get/set list of supplementary group IDs
git-deborig (1) - try to produce Debian orig.tar using git-archive(1)
git-get-tar-commit-id (1) - Extract commit ID from an archive created using git-archive
initgroups (3) - initialize the supplementary group access list
iscsi_discovery (8) - discover iSCSI targets
iscsistart (8) - iSCSI boot tool
lxc.restart (1) - Restart containers
lxc.start (1) - Start containers
lxc.launch (1) - Create and start containers from images
make-first-existing-target (1) - runs make on one of several targets
mk-origtargz (1) - rename upstream tarball, optionally changing the compression and removing unwanted files
open (1) - start a program on a new virtual terminal (VT).
openvt (1) - start a program on a new virtual terminal (VT).
optarg (3) - Parse command-line options
origtargz (1) - fetch the orig tarball of a Debian package from various sources, and unpack it
ptar (1) - a tar-like program written in perl
ptardiff (1) - program that diffs an extracted archive against an unextracted one
ptargrep (1) - Apply pattern matching to the contents of files in a tar archive
restart_syscall (2) - restart a system call after interruption by a stop signal
rmt-tar (8) - remote magnetic tape server
runc-start (8) - (unknown subject)
setarch (8) - change reported architecture in new program environment and set personality flags
setgroups (2) - get/set list of supplementary group IDs
setgroups32 (2) - get/set list of supplementary group IDs
start-stop-daemon (8) - start and stop system daemon programs
strfmon (3) - convert monetary value to a string
strfmon_l (3) - convert monetary value to a string
svc_getargs (3) - library routines for remote procedure calls
swapoff (2) - start/stop swapping to file/device
swapon (2) - start/stop swapping to file/device
systemd-notify (1) - Notify service manager about start-up completion and other daemon status changes
systemd-rc-local-generator (8) - Compatibility generator for starting /etc/rc.local and /usr/sbin/halt.local during boot and shutdown
systemd.target (5) - Target unit configuration
tar (1) - an archiving utility
tarcat (1) - concatenates the pieces of a GNU tar multi-volume archive
thermald (8) - start Linux thermal daemon
unicode_start (1) - put keyboard and console in unicode mode
va_start (3) - variable argument lists
$ man -k tar man-k-tar.txt
$ ls -l
total 260
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 8192 May 3 15:14 tar-gzip-gunzip-info.txt
$ man -k gunzip
gunzip (1) - compress or expand files
PerlIO::gzip (3pm) - Perl extension to provide a PerlIO layer to gzip/gunzip
$ which tar
/bin/tar
$ which gzip
/bin/gzip
$ which gunzip
/bin/gunzip
$ ls -la
total 272
drwxrwxr-x 2 wahid wahid 4096 May 3 15:14 .
drwxr-xr-x 9 wahid wahid 4096 May 3 14:26 ..
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 8192 May 3 15:14 tar-gzip-gunzip-info.txt
$ ls -l
total 516
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 8192 May 3 15:14 tar-gzip-gunzip-info.txt
$ date
Mon May 3 15:15:40 EDT 2021
$ date '+%m-%d%Y'
05-03-2021
$ ls -l
total 520
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 12288 May 3 15:15 tar-gzip-gunzip-info.txt
$ tar xvf all-files-`date '+%m-%d-%Y'`.tar *
all-files-Mon
fallocate-info.txt
figlet-info.txt
gzip.manpage
man-k-gunzip.txt
man-k-tar.txt
myxterm.sh
myxterm.sh.bak
tar-gzip-gunzip-info.txt
$ ls -l
total 1020
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 12288 May 3 15:15 tar-gzip-gunzip-info.txt
$ ls -ld *.tar
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
$ du -sh *.tar
500K all-files-05-03-2021.tar
$ tar tvf *.tar
-rw-rw-r-- wahid/wahid 256000 2021-05-03 15:15 all-files-Mon
-rw-rw-r-- wahid/wahid 137253 2021-05-03 15:11 fallocate-info.txt
-rw-rw-r-- wahid/wahid 74404 2021-05-03 14:50 figlet-info.txt
-rw-rw-r-- wahid/wahid 17201 2021-05-03 15:13 gzip.manpage
-rw-rw-r-- wahid/wahid 127 2021-05-03 15:14 man-k-gunzip.txt
-rw-rw-r-- wahid/wahid 4643 2021-05-03 15:14 man-k-tar.txt
-rwxr-xr-x wahid/wahid 594 2021-05-03 14:26 myxterm.sh
-rwxr-xr-x wahid/wahid 594 2021-05-03 15:13 myxterm.sh.bak
-rw-rw-r-- wahid/wahid 12288 2021-05-03 15:15 tar-gzip-gunzip-info.txt
$ mkdir Backup
$ cd Backup
$ ls -la
total 8
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 .
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 ..
$ cd ..
$ ls -al
total 1036
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 .
drwxr-xr-x 9 wahid wahid 4096 May 3 14:26 ..
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 Backup
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 16384 May 3 15:18 tar-gzip-gunzip-info.txt
$ pwd
/home/wahid/Scripts
$ ls -l Backup
total 0
$ pwd
/home/wahid/Scripts
$ mv *.tar Backup/.
$ ls -la
total 536
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 .
drwxr-xr-x 9 wahid wahid 4096 May 3 14:26 ..
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 Backup
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 16384 May 3 15:18 tar-gzip-gunzip-info.txt
$ cd Backup
$ ls -la
total 508
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 .
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 ..
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
$ du -sh *
500K all-files-05-03-2021.tar
$ ls -la
total 508
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 .
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 ..
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
$ tar xvf *.tar
all-files-Mon
fallocate-info.txt
figlet-info.txt
gzip.manpage
man-k-gunzip.txt
man-k-tar.txt
myxterm.sh
myxterm.sh.bak
tar-gzip-gunzip-info.txt
$ ls -la
total 1024
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 .
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 ..
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 12288 May 3 15:15 tar-gzip-gunzip-info.txt
$ ls -l ../
total 528
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 Backup
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 16384 May 3 15:18 tar-gzip-gunzip-info.txt
$ diff . ../.
Only in .: all-files-05-03-2021.tar
Only in ../.: Backup
$ ls -l
total 520
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 12288 May 3 15:15 tar-gzip-gunzip-info.txt
$ ls -l
total 1020
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 12288 May 3 15:15 tar-gzip-gunzip-info.txt
$ ls -ld *.tar
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
$ du -sh *.tar
500K all-files-05-03-2021.tar
$ tar tvf *.tar
-rw-rw-r-- wahid/wahid 256000 2021-05-03 15:15 all-files-Mon
-rw-rw-r-- wahid/wahid 137253 2021-05-03 15:11 fallocate-info.txt
-rw-rw-r-- wahid/wahid 74404 2021-05-03 14:50 figlet-info.txt
-rw-rw-r-- wahid/wahid 17201 2021-05-03 15:13 gzip.manpage
-rw-rw-r-- wahid/wahid 127 2021-05-03 15:14 man-k-gunzip.txt
-rw-rw-r-- wahid/wahid 4643 2021-05-03 15:14 man-k-tar.txt
-rwxr-xr-x wahid/wahid 594 2021-05-03 14:26 myxterm.sh
-rwxr-xr-x wahid/wahid 594 2021-05-03 15:13 myxterm.sh.bak
-rw-rw-r-- wahid/wahid 12288 2021-05-03 15:15 tar-gzip-gunzip-info.txt
$ mkdir Backup
$ cd Backup
$ ls -la
total 8
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 .
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 ..
$ cd ..
$ ls -al
total 1036
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 .
drwxr-xr-x 9 wahid wahid 4096 May 3 14:26 ..
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 Backup
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 16384 May 3 15:18 tar-gzip-gunzip-info.txt
$ pwd
/home/wahid/Scripts
$ ls -l Backup
total 0
$ pwd
/home/wahid/Scripts
$ mv *.tar Backup/.
$ ls -la
total 536
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 .
drwxr-xr-x 9 wahid wahid 4096 May 3 14:26 ..
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 Backup
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 16384 May 3 15:18 tar-gzip-gunzip-info.txt
$ cd Backup
$ ls -la
total 508
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 .
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 ..
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
$ du -sh *
500K all-files-05-03-2021.tar
$ ls -la
total 508
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 .
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 ..
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
$ tar xvf *.tar
all-files-Mon
fallocate-info.txt
figlet-info.txt
gzip.manpage
man-k-gunzip.txt
man-k-tar.txt
myxterm.sh
myxterm.sh.bak
tar-gzip-gunzip-info.txt
$ ls -la
total 1024
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 .
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 ..
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 12288 May 3 15:15 tar-gzip-gunzip-info.txt
$ ls -l ../
total 528
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 Backup
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw
$ pwd
/home/wahid/Scripts/Backup
$ cd ..
$ ls -la
total 548
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 .
drwxr-xr-x 9 wahid wahid 4096 May 3 14:26 ..
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 Backup
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 28672 May 3 15:19 tar-gzip-gunzip-info.txt
$ diff . Backup
Only in Backup: all-files-05-03-2021.tar
Only in .: Backup
$ date
Mon May 3 15:15:40 EDT 2021
$ date '+%m-%d%-Y'
05-03-2021
$ ls -l
total 520
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 12288 May 3 15:15 tar-gzip-gunzip-info.txt
$ tar xvf all-files-`date '+%m-%d-%Y'`.tar
all-files-Mon
fallocate-info.txt
figlet-info.txt
gzip.manpage
man-k-gunzip.txt
man-k-tar.txt
myxterm.sh
myxterm.sh.bak
tar-gzip-gunzip-info.txt
$ ls -l
total 1020
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 12288 May 3 15:15 tar-gzip-gunzip-info.txt
$ ls -ld *.tar
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
$ du -sh *.tar
500K all-files-05-03-2021.tar
$ tar tvf *.tar
-rw-rw-r-- wahid/wahid 256000 2021-05-03 15:15 all-files-Mon
-rw-rw-r-- wahid/wahid 137253 2021-05-03 15:11 fallocate-info.txt
-rw-rw-r-- wahid/wahid 74404 2021-05-03 14:50 figlet-info.txt
-rw-rw-r-- wahid/wahid 17201 2021-05-03 15:13 gzip.manpage
-rw-rw-r-- wahid/wahid 127 2021-05-03 15:14 man-k-gunzip.txt
-rw-rw-r-- wahid/wahid 4643 2021-05-03 15:14 man-k-tar.txt
-rwxr-xr-x wahid/wahid 594 2021-05-03 14:26 myxterm.sh
-rwxr-xr-x wahid/wahid 594 2021-05-03 15:13 myxterm.sh.bak
-rw-rw-r-- wahid/wahid 12288 2021-05-03 15:15 tar-gzip-gunzip-info.txt
$ mkdir Backup
$ cd Backup
$ ls -la
total 8
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 .
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 ..
$ cd ..
$ ls -al
total 1036
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 .
drwxr-xr-x 9 wahid wahid 4096 May 3 14:26 ..
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 Backup
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 16384 May 3 15:18 tar-gzip-gunzip-info.txt
$ pwd
/home/wahid/Scripts
$ ls -l Backup
total 0
$ pwd
/home/wahid/Scripts
$ mv *.tar Backup/.
$ ls -la
total 536
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 .
drwxr-xr-x 9 wahid wahid 4096 May 3 14:26 ..
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 Backup
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 16384 May 3 15:18 tar-gzip-gunzip-info.txt
$ cd Backup
$ ls -la
total 508
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 .
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 ..
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
$ du -sh *
500K all-files-05-03-2021.tar
$ ls -la
total 508
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 .
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 ..
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
$ tar xvf *.tar
all-files-Mon
fallocate-info.txt
figlet-info.txt
gzip.manpage
man-k-gunzip.txt
man-k-tar.txt
myxterm.sh
myxterm.sh.bak
tar-gzip-gunzip-info.txt
$ ls -la
total 1024
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 .
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 ..
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 12288 May 3 15:15 tar-gzip-gunzip-info.txt
$ ls -l ../
total 528
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 Backup
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 16384 May 3 15:18 tar-gzip-gunzip-info.txt
$ diff . ../.
Only in .: all-files-05-03-2021.tar
Only in ../.: Backup
diff ./tar-gzip-gunzip-info.txt .././tar-gzip-gunzip-info.txt
188c188,345
wahid
\ No newline at end of file
---
$ date
Mon May 3 15:15:40 EDT 2021
$ date '+%m-%d%Y'-%Y'
05-03-2021
$ ls -l
total 520
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 12288 May 3 15:15 tar-gzip-gunzip-info.txt
$ tar xvf all-files-`date '+%m-%d-%Y'`.tar
all-files-Mon
fallocate-info.txt
figlet-info.txt
gzip.manpage
man-k-gunzip.txt
man-k-tar.txt
myxterm.sh
myxterm.sh.bak
tar-gzip-gunzip-info.txt
$ ls -l
total 1020
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 12288 May 3 15:15 tar-gzip-gunzip-info.txt
$ ls -ld *.tar
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
$ du -sh *.tar
500K all-files-05-03-2021.tar
$ tar tvf *.tar
-rw-rw-r-- wahid/wahid 256000 2021-05-03 15:15 all-files-Mon
-rw-rw-r-- wahid/wahid 137253 2021-05-03 15:11 fallocate-info.txt
-rw-rw-r-- wahid/wahid 74404 2021-05-03 14:50 figlet-info.txt
-rw-rw-r-- wahid/wahid 17201 2021-05-03 15:13 gzip.manpage
-rw-rw-r-- wahid/wahid 127 2021-05-03 15:14 man-k-gunzip.txt
-rw-rw-r-- wahid/wahid 4643 2021-05-03 15:14 man-k-tar.txt
-rwxr-xr-x wahid/wahid 594 2021-05-03 14:26 myxterm.sh
-rwxr-xr-x wahid/wahid 594 2021-05-03 15:13 myxterm.sh.bak
-rw-rw-r-- wahid/wahid 12288 2021-05-03 15:15 tar-gzip-gunzip-info.txt
$ mkdir Backup
$ cd Backup
$ ls -la
total 8
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 .
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 ..
$ ls -al
total 8
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 .
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 ..
$ cd ..
$ ls -al
total 1036
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 .
drwxr-xr-x 9 wahid wahid 4096 May 3 14:26 ..
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 Backup
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 16384 May 3 15:18 tar-gzip-gunzip-info.txt
$ pwd
/home/wahid/Scripts
$ ls -l backup Backup
total 0
$ pwd
/home/wahid/Scripts
$ mv *.tar Backup/.
$ ls -la
total 536
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 .
drwxr-xr-x 9 wahid wahid 4096 May 3 14:26 ..
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 Backup
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 16384 May 3 15:18 tar-gzip-gunzip-info.txt
$ cd Backup
$ ls -la
total 508
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 .
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 ..
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
$ du -sh *
500K all-files-05-03-2021.tar
$ ls -la
total 508
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 .
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 ..
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
$ tar xvf *.tar
all-files-Mon
fallocate-info.txt
figlet-info.txt
gzip.manpage
man-k-gunzip.txt
man-k-tar.txt
myxterm.sh
myxterm.sh.bak
tar-gzip-gunzip-info.txt
ls -la
total 1024
drwxrwxr-x 2 wahid wahid 409
\ No newline at end of file
---
wahid
\ No newline at end of file
$ ls -la
total 564
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 .
drwxr-xr-x 9 wahid wahid 4096 May 3 14:26 ..
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 Backup
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 45056 May 3 15:19 tar-gzip-gunzip-info.txt
$ cd Backup
$ ls -al
total 1024
drwxrwxr-x 2 wahid wahid 4096 May 3 15:18 .
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 ..
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
-rw-rw-r-- 1 wahid wahid 137253 May 3 15:11 fallocate-info.txt
-rw-rw-r-- 1 wahid wahid 74404 May 3 14:50 figlet-info.txt
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rw-rw-r-- 1 wahid wahid 127 May 3 15:14 man-k-gunzip.txt
-rw-rw-r-- 1 wahid wahid 4643 May 3 15:14 man-k-tar.txt
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
-rw-rw-r-- 1 wahid wahid 12288 May 3 15:15 tar-gzip-gunzip-info.txt
$ rm *.txt
$ ls -la
total 788
drwxrwxr-x 2 wahid wahid 4096 May 3 15:19 .
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 ..
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
$ ls -l | awk '{print $9}'
all-files-05-03-2021.tar
all-files-Mon
gzip.manpage
myxterm.sh
myxterm.sh.bak
$ ls -l | awk '{print $9}' | awk grep -v tar
all-files-Mon
gzip.manpage
myxterm.sh
myxterm.sh.bak
$ ls -l | awk '{print $9}' | grep -v tar
all-files-Mon
gzip.manpage
myxterm.sh
myxterm.sh.bak
$ ls -l | egrep -v 'total|tar'
-rw-rw-r-- 1 wahid wahid 256000 May 3 15:15 all-files-Mon
-rw-rw-r-- 1 wahid wahid 17201 May 3 15:13 gzip.manpage
-rwxr-xr-x 1 wahid wahid 594 May 3 14:26 myxterm.sh
-rwxr-xr-x 1 wahid wahid 594 May 3 15:13 myxterm.sh.bak
$ ls -l | egrep -v 'total|tar' | awk '{print $9}'
all-files-Mon
gzip.manpage
myxterm.sh
myxterm.sh.bak
$ ls -l | egrep -v 'total|tar' | awk '{print $9}' | while read var
do
echo "Removing the file ${var} now ..."
rm $var ${var}
done
Removing the file all-files-Mon now ...
Removing the file gzip.manpage now ...
Removing the file myxterm.sh now ...
Removing the file myxterm.sh.bak now ...
$ ls -l
total 500
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
$ file *.tar
all-files-05-03-2021.tar: POSIX tar archive (GNU)
$ ls -l
total 500
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
$ file *
all-files-05-03-2021.tar: POSIX tar archive (GNU)
gunzip *
gzip: all-files-05-03-2021.tar: unknown suffix -- ignored
$ ls -la
total 508
drwxrwxr-x 2 wahid wahid 4096 May 3 15:21 .
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 ..
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
$ file *.tar
all-files-05-03-2021.tar: POSIX tar archive (GNU)
$ du -sh *.tar
500K all-files-05-03-2021.tar
$ gzip all-files-05-03-2021.tar
$ ls -l
total 80
-rw-rw-r-- 1 wahid wahid 80255 May 3 15:17 all-files-05-03-2021.tar.gz
$ du -sh *
80K all-files-05-03-2021.tar.gz
$ file *
all-files-05-03-2021.tar.gz: gzip compressed data, was "all-files-05-03-2021.tar", last modified: Mon May 3 19:17:46 2021, from Unix
$ gunzip *.gz
$ ls -la
total 508
drwxrwxr-x 2 wahid wahid 4096 May 3 15:22 .
drwxrwxr-x 3 wahid wahid 4096 May 3 15:18 ..
-rw-rw-r-- 1 wahid wahid 512000 May 3 15:17 all-files-05-03-2021.tar
p-gunzip-info.txt
$file *
all-files-05-03-2021.tar: POSIX tar archive (GNU)
tar
$ du -sh *.tar
500K all-files-05-03-2021.tar
$ ls -l
total 80
-rw-rw-r-- 1 wahid wahid 80255 May 3 15:17 all-files-05-03-2021.tar.gz
$ du -sh *
80K all-files-05-03-2021.tar.gz
$ file *
all-files-05-03-2021.tar.gz: gzip compressed data, was "all-files-05-03-2021.tar", last modified: Mon May 3 19:17:46 2021, from Unix
Please click on " man tar " to see the Manual Page for this command.
man gzip " to see the Manual Page for this command.
man gunzip " to see the Manual Page for this command.
man zcat " to see the Manual Page for this command.