Let's create a backup for all the bash scripts in the /home/elliot directory. As the root user, create a directory named backup in /root:
root@ubuntu-linux:~# mkdir /root/backup
To create an archive, we use the tape archive command tar. The general syntax to create an archive is as follows:
tar -cf archive_name files
The -c option is the shorthand notation of --create, which creates the archive. The -f option is the shorthand notation of --file, which specifies the archive name.
Now let's create an archive named scripts.tar in /root/backup for all the bash scripts in /home/elliot. To do that, we first change to the /home/elliot directory:
root@ubuntu-linux:~# cd /home/elliot
root@ubuntu-linux:/home/elliot#
Then we run the command:
root@ubuntu-linux:/home/elliot# tar -cf /root/backup/scripts.tar *.sh
This will create the archive file scripts.tar in /root/backup, and there will be no command output:
root@ubuntu-linux:/home/elliot# ls -l /root/backup/scripts...