Question

I need help to understand the following command.

tar -cvf /dev/nst0 /home/user1 >> file1.log
Was it helpful?

Solution

Read the man page :

-c stands for create
-v is for verbose
-f specify the archive name

And tar -cvf is equivalent to tar -c -v -f, so what this is doing is creating an archive of /home/user1 into /dev/nst0. The >> file1.log is redirecting and appending the standard output to file1.log. tar -cvf archive_name [files] > file.log would erase any existing content in file1.log

Have a look here for an explanation on I/O redirection

OTHER TIPS

In addition to shodanex's answer: this creates a tar archive, written to /dev/nst0 (a tape drive?) from /home/user1 and appends the output (remember verbose -v) to file1.log

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top