Loading...
Loading...
-bash: ./script.sh: Permission deniedThe file exists but your user doesn't have permission to execute, read, or write it. Linux file permissions control who can do what with each file.
Use chmod to make a script executable.
# Make script executable for the owner
chmod +x script.sh
# Make executable for everyone
chmod a+x script.sh
# Check current permissions
ls -la script.shChange the file owner to your current user.
# Change owner to current user
sudo chown $USER:$USER filename
# Change owner recursively for a directory
sudo chown -R $USER:$USER /path/to/directoryUse our visual chmod calculator to generate the exact permission command you need. Visit /tools/chmod-calculator/ to build your chmod command visually.