Skip to content

Instantly share code, notes, and snippets.

@victory-sokolov
Last active November 23, 2023 14:39
Show Gist options
  • Save victory-sokolov/0dbb175ee44e8ff5be0af3a04bb1a3c0 to your computer and use it in GitHub Desktop.
Save victory-sokolov/0dbb175ee44e8ff5be0af3a04bb1a3c0 to your computer and use it in GitHub Desktop.
Bash Tips/Tricks
# find folder location by folder name
dir=$(sudo find $HOME -type d -name folderName)
cd $dir
# print file data that starts from specific text
cat .flake8 | sed -n -e '/exclude = /,$p'
#Check if file extension is png
if [[ "${file#*.}" != "png" ]]; then
echo "File extensions must be .png"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment