Created
April 19, 2024 14:13
-
-
Save dejurin/e5e16814f9958ea4079f7c947ad600ca to your computer and use it in GitHub Desktop.
This script creates a zip archive of the current directory, excluding files starting with '.DS_', and names the archive after the current directory.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script: create_archive.sh | |
# Description: This script creates a zip archive of the current directory, excluding files starting with '.DS_', and names the archive after the current directory. | |
# Assign the name of the current directory to the variable 'folder_name' | |
folder_name=$(basename "$PWD") | |
# Find files in the current directory and its subdirectories, excluding those whose names start with '.DS_', and zip them into an archive named after the current directory | |
find . -type f -not -name '.DS_*' -exec zip "$folder_name.zip" {} + |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment