LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-18-2005, 12:59 PM   #1
rocky180
LQ Newbie
 
Registered: Aug 2005
Posts: 3

Rep: Reputation: 0
how to tar dot files?


Hi,

Was just wondering how to tar . files? Cos I heard that it doesn't!

Rocky180
 
Old 08-18-2005, 01:34 PM   #2
Boow
Member
 
Registered: Feb 2004
Distribution: Slackware 10.2
Posts: 669

Rep: Reputation: 32
Do you mean hidden files and directorys
 
Old 08-18-2005, 01:37 PM   #3
rocky180
LQ Newbie
 
Registered: Aug 2005
Posts: 3

Original Poster
Rep: Reputation: 0
Yes I do mean hidden files and directories.

Am interested in making sure everything is backed up from a specific point all the way in.

Rocky180
 
Old 08-18-2005, 01:49 PM   #4
rnicolson
Member
 
Registered: Jul 2004
Location: Winnipeg
Distribution: Slackware 11
Posts: 74

Rep: Reputation: 15
If you are doing an entire directory you can do this;

tar cfv test.tar test/

This will create test.tar containing the entire directory test which has hidden files in it.

$ tar cfv test.tar test/
test/
test/test
test/.test1

was the output from my test of this command.
 
Old 08-18-2005, 01:49 PM   #5
Boow
Member
 
Registered: Feb 2004
Distribution: Slackware 10.2
Posts: 669

Rep: Reputation: 32
yes tar will archive every thing in a directory hidden stull as well.
 
Old 08-18-2005, 02:06 PM   #6
rocky180
LQ Newbie
 
Registered: Aug 2005
Posts: 3

Original Poster
Rep: Reputation: 0
Yes all good, even tested it myself.

Thanks.

I wonder why one of my bosses has spent ages redeveloping the wheel as he was under the impression that tar didn't do hidden file, which in turn made me beleive it didn't either.

Anyways there must be a reason.

Thanks again.

Rocky180.

ps. Is there a way to close the thread?
 
Old 08-22-2007, 04:54 AM   #7
whittycat
Member
 
Registered: Nov 2004
Location: Wellington Somerset UK
Distribution: Debian lenny, also DSL-N
Posts: 32

Rep: Reputation: 15
tar usually archives hidden files and directories but there is one way it might not. If you run tar from within the directory like this

cd test
tar cf ../test.tar *

the the hidden files don't get archived. That may be what the boss was doing. It is not too surprising since with

ls -R *

you don't get them so it is the natural way to understand *.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RSYNC and dot files Buto Linux - General 1 09-22-2005 03:39 PM
Strip leading dot in filepaths (in tar archive) EcceVery Debian 2 04-13-2005 08:47 PM
proftpd and dot files bsmith Linux - General 1 05-14-2004 03:55 AM
useradd not accepting dot so i am not able to use dot in mail id hanu_raob Linux - General 5 05-13-2004 08:04 AM
Samba won't hide dot files josephswagner Linux - Software 1 02-25-2003 09:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration