Skip to content

Instantly share code, notes, and snippets.

@Azer5C74
Last active March 26, 2023 12:58
Show Gist options
  • Save Azer5C74/6deca5da58f76fad743e393f2c07fdbb to your computer and use it in GitHub Desktop.
Save Azer5C74/6deca5da58f76fad743e393f2c07fdbb to your computer and use it in GitHub Desktop.
Run phpstorm as sudo so you can edit all the project files. Make sure to add the permission to execute to the file by running this command : $ chmod +x sPhpStorm.sh
#!/bin/bash
# Find the path to PhpStorm
phpstorm_path=$(find / -name "phpstorm.sh" 2>/dev/null | head -n 1)
# Check if PhpStorm was found
if [[ -z "$phpstorm_path" ]]; then
echo "PhpStorm not found"
exit 1
fi
# Run PhpStorm as sudo
sudo "$phpstorm_path"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment