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? |
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 - |
That was fast. Thanks, it is perfect!
|
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 - .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 06:35 PM. |