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

Status
Not open for further replies.

Dark-King

Forum Veteran
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.

About this Thread

  • 2
    Replies
  • 447
    Views
  • 2
    Participants
Last reply from:
Dark-King

Online now

Members online
1,065
Guests online
817
Total visitors
1,882

Forum statistics

Threads
2,276,986
Posts
28,973,619
Members
1,229,681
Latest member
HawFlakes
Back
Top