Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Zipping without extension

$
0
0
I currently have a code that find and zip all files in current folder and zip it, the problem is the name of the zip will include the extension as well and I don't want it.

for ex:

Volvo-red.swf -> Volvo-red.swf.zip

find . -maxdepth 1 -type f ! -name ".*" -exec bash -c 'zip -r "$0.zip" "$0"' {} \;

What's the trick to ignore the extension and only use the name like?

like: Volvo-red.swf -> Volvo-red.zip

Appreciate any response.

Viewing all articles
Browse latest Browse all 16232

Trending Articles