LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 11:59 AM   #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, 12: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, 12: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, 12: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, 12: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, 01: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, 03: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



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 02:39 PM
Strip leading dot in filepaths (in tar archive) EcceVery Debian 2 04-13-2005 07:47 PM
proftpd and dot files bsmith Linux - General 1 05-14-2004 02: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 07:04 AM
Samba won't hide dot files josephswagner Linux - Software 1 02-25-2003 08:25 AM

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

All times are GMT -5. The time now is 03:13 AM.

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
Open Source Consulting | Domain Registration