I'm trying to zip a file from the command line while I'm currently working in a different directory than that file is in.
The file is located at /home/one/file.txt
The present working directory is /home/two/
When I use the command zip /home/one/file.zip /home/one/file.txt
, the zip file is created in the correct directory (/home/one
), but the contents of the zip file are /home/one/file.txt
. I want for the zip file to only contain file.txt
.
What's the command to do this?