How can I zip a file and save it in another directory using the command line? I have no space left in directory (100% full).
zip -r /path/to/save/destination_folder.zip /path/to/folder
/path/to/folder - path to your source folder
/path/to/save/destination_folder.zip - path to destination zip-file
r - recurse into directories
Also you can just type
zip in putty command prompt to get help information
Please, notice I wrote information for *nix systems. For Win it could be differ.
Quickly looking at the man pages for tar, we can set the output file with -f
I usually use something of the form:
tar -a -cf filename.tar.bz2 input_fname.txt
Then you can specify your filepath as part of your filename to output.
../../output.tgz would work as a filename. Then you would end up with your compressed file at that place.
- a: auto compress: Uses your given file type to figure out what to do.
- c: compress: Tells it to compress instead of decompressing
- f: set a file name: allows you to specify your file and file path. You can also give relative path names as well.
I'm hoping that tar compression just puts everything at the output file and doesn't do anything in your directory. Try it and see if it works though.