This Shell script is designed to find and delete node_modules
folders within the specified directory and its subdirectories. Once a node_modules
folder is found and deleted, the script will not search deeper within that folder.
- Bash (Available on Linux and macOS by default, or use Git Bash on Windows)
-
Clone this repository or download the
delete_node_modules.sh
script to your local machine. -
Open a terminal and navigate to the directory containing the
delete_node_modules.sh
script. -
Make the script executable by running the following command:
chmod +x delete_node_modules.sh
- Run the script by providing the path to the folder you want to search:
./delete_node_modules.sh /path/to/your/folder
- The script will search for node_modules folders and delete them. At the end of the execution, it will print a list of absolute paths where the node_modules folders were deleted.
Please use this script at your own risk. It is recommended to create a backup of your files before running the script to avoid any data loss in case of unexpected issues.