Help with tar command

Discussion in 'Linux VPS/Dedicated - cPanel' started by Wired Techie, Dec 3, 2008.

  1. Wired Techie

    Wired Techie New Member

    Hi all,

    While I am waiting on sales here, I have a question on the tar command, I do know how to extract tar files via command line (SSH) but i need the command to archive everything (including hidden files and sub-directories).

    Since all my domains where I am at are all under html, I figured I may be able to archive the contents then download one archive file, then I can manually ftp each site to the correct location here after creating the domains.

    I just figured this way may be quicker then downloading every account individually when I can get them all at once,

    so in a nutshell, I want to archive everything in the html directory including dot files and sub-directories. I've never used tar in reverse, always had a manager to do that. :)

    I'll probably do the actual moving on my Debian system.

    I know that I could FTP the entire directory to my Debian, but that takes way over 2 hours to download. (Speeds are terrible and upload is way worse, which is why I'm coming back here to stay.)

    Thanks,

    Jeff
     
  2. Dan

    Dan Moderator

    Hello Wired and welcome back! :D

    Hidden files will be tarred no problem there. The command you'll want is: tar czvf filename.tar directoryname

    The options there are
    c = create
    z = zip
    v = verbose (show files)
    f = file
     

Share This Page