Results 1 to 7 of 7
Hello
I want to know how can I use the zip or tar command to compress a directory (recursively) and limit the filesize of the archive. Also, I want to ...
- 11-11-2009 #1Just Joined!
- Join Date
- May 2008
- Posts
- 34
zip usage question
Hello
I want to know how can I use the zip or tar command to compress a directory (recursively) and limit the filesize of the archive. Also, I want to write the contents of the zip or tar file (dirs and files) to a .txt file so that I know what's where according to the tar filename and txt file name.
- 11-11-2009 #2
i use the archiver and compression tool 7-zip.
in the command line you can "zip" a directory with:
and it integrates well in the file manager nautilus, if you use it, that is.Code:$ 7z a directory
and you can know the contents of the directory.7z archive with:
Code:$ 7z l directory.7z > contents.txt
Last edited by clickalot; 11-11-2009 at 09:51 PM. Reason: mistake
- 11-11-2009 #3Just Joined!
- Join Date
- May 2008
- Posts
- 34
Ok I only have ssh access to this server. I installed the 7zip rpm package..how do i call it ?
Code:root@spyder ~]# 7z l directory > contents.txt -bash: 7z: command not found
- 11-11-2009 #4
i don't know any details of your operating system or what you want to do...
you said 7-zip is installed. can you run this:
Code:$ whereis 7z
- 11-12-2009 #5Just Joined!
- Join Date
- May 2008
- Posts
- 34
Code:-bash: 7z: command not found [root@spyder ~]# whereis 7z 7z: [root@spyder ~]# whereis p7zip p7zip: /usr/bin/p7zip /usr/libexec/p7zip /usr/share/p7zip [root@spyder ~]#
- 11-12-2009 #6
it looks like you have a different port of 7-zip ...
anyway what i told you for 7z should work the same with p7zip (with the same options except you substitute 7z with p7zip...)
Don't be shy and try:
You should also try a more conventional approach in the *nix world:Code:$ man p7zip
(actually maybe this is what you were looking for in the first place
tar and gzip a directory :
list contents of a tarball (gzip'ed tar archive) :Code:$ tar -cvzf directory.tar.gz directory/
extract the tarball :Code:$ tar -tzf archive.tar.gz
Code:$ tar -xvzf archive.tar.gz
- 11-12-2009 #7Just Joined!
- Join Date
- May 2008
- Posts
- 34
But its ok your help solved the problem, thanksCode:[root@spyder ss]# man p7zip No manual entry for p7zip

tar command got the job done.


Reply With Quote