I am attempting to use the zip -r
command to zip a folder which includes two files. I need to pass the absolute path of the folder with two files (/path/to/my/files/)
, which is causing all of the folders to be zipped with it, where as I only need the last folder (files/)
and its contents to be zipped, so that when the file is unzipped, there is only one folder and the two files within it. How can I modify the command to be able to pass the absolute paths in the arguments while keeping only the last folder?
Ubuntu – Zipping folder with absolute path without keeping tree of folders
command-line-interfacecompressionUbuntu
Related Topic
- Linux – Zip up a folder, but only include folders with numerical names
- WinZip, 7zip, Winrar Command Line to Compress structure of folders
- Linux – Can the encryption option with zip on Linux when used from the command line
- Windows – Command-Line folder structure on Windows
- Linux – Deleting Files in a Zip Archive on Linux
Best Answer
zip operates from the current working directory. If you have to return to the working directory you started from, that can work too.
Try: