Hi gents.
I've never tried making a script in Bash before. So I could use some help.
I've made this script. The generel idea is to delete all files in the folder smaller than 200MB, then all files not mp4. The move the rest of the files to a folder called done. Afterwards I wan't to delete the old folder (part not done yet). But already now SAB says that it can not run this script. What am I missing? I assume it know that the complete folder is the main (default) folder.
#!/bin/bash
find . -name "*.*" -size -200MB - delete
find . -type f ! -name "*.mp4" - delete
mv "*.mp4" done/
all help and ideas are welcome.
help with my script
Re: help with my script
Make sure the script is executable.
chmod +x name
Also, use single quotes when using wildcards in a find statement.
chmod +x name
Also, use single quotes when using wildcards in a find statement.
Re: help with my script
should i "just" write it in the beginning of the script? Also the file should be .sh right?
Re: help with my script
In terminal, you need to run
Makes the script executable.
Code: Select all
chmod +x /path/to/your/script