Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
05-24-2008, 12:34 PM
|
#1
|
Member
Registered: Apr 2004
Distribution: CentOS6, CentOS5, F16, F15, Ubuntu, OpenSuse
Posts: 620
Rep:
|
Archive dotfiles and dotdirectories only
I'm not exactly sure how to do this.
Is there a quick and easy way to archive ONLY .files and .directories only (i.e. only 'hidden' files)?
I guess I could pipe an ls output and grep for " ." and then incrementally add to an archive. Is there a easier/more reliable way?
|
|
|
05-24-2008, 12:43 PM
|
#2
|
LQ Guru
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852
|
I was trying to do the same thing recently and had a pretty tough time finding any answers. With some help from board members I eventually settled on this command, which I incorporated into a simple script.
Code:
ls -A | egrep '^\.' | tar -cvf filename.tar -T -
|
|
|
05-24-2008, 12:47 PM
|
#3
|
Member
Registered: Apr 2004
Distribution: CentOS6, CentOS5, F16, F15, Ubuntu, OpenSuse
Posts: 620
Original Poster
Rep:
|
That was fast. Thanks, it is perfect!
|
|
|
05-28-2008, 10:01 PM
|
#4
|
LQ Newbie
Registered: May 2008
Posts: 1
Rep:
|
i run your command i my home direktori, but i got this message in the end of line
Code:
ls -A | egrep '^\.' | tar -cvf filename.tar -T -
.Xauthority
.xine/
.xine/catalog.cache
.xsession-errors
.zshrc
tar: Error exit delayed from previous errors
whats wrong with this?
|
|
|
All times are GMT -5. The time now is 05:15 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|