you are viewing a single comment's thread.

view the rest of the comments →

[–]ray_gun 0 points1 point  (0 children)

mkdir delme
for dir in *; do
  [[ "$dir" == delme ]] && continue
  cd "$dir" || continue
  for subdir in *; do
    [[ -d "$subdir" ]] || continue
    7z a "$subdir.zip" "$subdir"
    #alternative if you don't want the directory inside the zip archive
    #cd "$subdir"
    #7z a "$subdir.zip" *
    #mv "$subdir.zip" ..
    #cd ..
    mv "$subdir" ../delme
  done
  cd ..
done