What's new

Closed how to archive all files in a specific folder(ex. Documents) using script

Status
Not open for further replies.

Kernel Died

Forum Veteran
Elite
Joined
Dec 24, 2016
Posts
2,411
Reaction
1,176
Points
726
Age
23
Guys pa help po paano po ba i archive lahat ng files or content sa isang folder like documents folder gamit po ang script.

Thanks po
 
Check the filesize of the directory first:
user@debian10:~$ du -sh programming/bash/
1.2M programming/bash/

--------------------------------------------------------------

Then archive and compress it (bzip2):
tar cvpjf myarchive.tar.bz2 programming/bash/

--------------------------------------------------------------

Finally, check the filesize of your archive:
user@debian10:~$ ls -lh myarchive.tar.bz2
-rw-r--r-- 1 user user 460K Jan 27 07:58 myarchive.tar.bz2
 
Check the filesize of the directory first:
user@debian10:~$ du -sh programming/bash/
1.2M programming/bash/

--------------------------------------------------------------

Then archive and compress it (bzip2):
tar cvpjf myarchive.tar.bz2 programming/bash/

--------------------------------------------------------------

Finally, check the filesize of your archive:
user@debian10:~$ ls -lh myarchive.tar.bz2
-rw-r--r-- 1 user user 460K Jan 27 07:58 myarchive.tar.bz2
Ok na po hehehe.
Thanks po
 
Status
Not open for further replies.
Back
Top