Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
tar = Stands for "tape archive" This is a legacy-name for when mag tape was king of backup.
c = 'create' (as opposed to extract)
v = 'verbose'. You can miss this out but it won't tell you which files are being worked on.
f = means specify a file to use as the device. Remember, everything in linux is a 'file' so
the beauty of linux (and unix) is that what works with a specical file like a tape device
will also work for any file - including an entry in a block-special filesystem or a the special
file stdout which is used next in this case.
- = 'stdout' This is the default output for all programs. It is usually - but not allways the
screen. Typically, stdout is 'piped' to another program for further processing.
. = 'current directory'. Therefore this whole comman is context dependent. You must have done a cd
into the desired directory before executing it.
| = 'redirect stdout' to 'stdin' of the following program.
() = create a new shell. Thus the stdin of the tar command is fed to a new shell. Inside this shell,
you can do a whole load of commands.
cd /root/ = 'change directory (inside this subshell only) to a new place - this is the destination
of the backup)
; = 'end of this line - what follows is a new command as if you pressed RETURN first.'
tar xvf - = 'rn tar again' but this time x means eXtract. 'f' has the same meansing, but this time '-'
I like setting up no password handshaking between servers, such as for a migration, then run the following from any directory. Most of the time I will set up the script to run after hours in cron for each directory I want to move:
tar cf - . | ssh <servername> "cd /path-to-dir; tar xf -"