Skip to content

Instantly share code, notes, and snippets.

@uladkasach
Last active July 17, 2017 14:10
Show Gist options
  • Save uladkasach/c25a6b3f71365575aea8d390773be163 to your computer and use it in GitHub Desktop.
Save uladkasach/c25a6b3f71365575aea8d390773be163 to your computer and use it in GitHub Desktop.
useful regex and unix commands
[^\\\\]console.log
## find string which exists in any file recursivly throughout directory
grep -r -o -i "string" *
## find files w/ names containing string
find . -type f -name "*string*"
## detect if script is being run from terminal or another script
if [[ -t 1 ]]; then
echo "Terminal"
else
echo "Not-a-terminal"
fi
remove user's crontab file `sudo crontab -r -u datim4u_backup_manager`
sudo apt-get install -y debconf-utils
Then find debconf related to MySQL:
sudo debconf-get-selections | grep mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment