1 |
find . -name .\* | tar cvf ../filename.tar -T - |
A bunch of old home directories, that you want to tar up by making sure you get all the hidden .files/directories
1 2 3 4 5 6 |
<span style="font-size: 13px;">Say your home directories were.. <span style="font-size: 13px;">/home/user1 <span style="font-size: 13px;">/home/user2 <span style="font-size: 13px;">/home/user3 <span style="font-size: 13px;">and so on.. <span style="font-size: 13px;">And you wanted to tar up all the home directories to /opt/oldhome</span></span></span></span></span></span> |
cd /home
for i in *; Â do cd $i; find . -name .\*| tar cvf /opt/oldhome/$i.tar -T-; cd ..;done