Results 1 to 6 of 6

Thread: help with the tar command

  1. #1
    Join Date
    Mar 2007
    Beans
    212

    help with the tar command

    I want to tar my home directory and save it to an external hard drive before i upgrade to 9.04. I seem to be having trouble doing it. If i navigate to my external hard drive in the terminal, i will want to use the -C $HOME flag? and the -f filename? i know i use tar -c to create an archive but im not sure about which other flags to use. And i know i do it as root.

  2. #2
    Join Date
    Jul 2007
    Location
    Wattisham, UK
    Beans
    2,473
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: help with the tar command

    Code:
    tar cvfz filename.tar.gz /home/username
    You'll probably need to do it from /home as sudo too.

    Edit: to expand on that, c = create, v=verbose, f=archive file, z=gzip compression.
    (12:25:08 PM) sabdfl: if Linux is just another way to run Windows apps, we can't win
    (12:25:13 PM) sabdfl: OS/2 tried that


    Blog | Dropbox

  3. #3
    Join Date
    Mar 2007
    Beans
    212

    Re: help with the tar command

    i need to be in my $HOME directory?

  4. #4
    Join Date
    Jul 2007
    Location
    Wattisham, UK
    Beans
    2,473
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: help with the tar command

    You could do it direct to the removable drive if you want:
    Code:
    tar cfvz /media/harddisk/filename.tar.gz /home/username
    (12:25:08 PM) sabdfl: if Linux is just another way to run Windows apps, we can't win
    (12:25:13 PM) sabdfl: OS/2 tried that


    Blog | Dropbox

  5. #5
    Join Date
    Mar 2007
    Beans
    212

    Re: help with the tar command

    thanks, i tried it from my external and it worked. I had the filename and directory backwards, i was listing the filename second and the directory first, that was my problem. Thanks for your help.

  6. #6
    Join Date
    Jul 2007
    Location
    Wattisham, UK
    Beans
    2,473
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: help with the tar command

    I often have to check tar with the man command because it seems illogical to tell it the filename to create before telling it what to put in it.
    (12:25:08 PM) sabdfl: if Linux is just another way to run Windows apps, we can't win
    (12:25:13 PM) sabdfl: OS/2 tried that


    Blog | Dropbox

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •