Skip to content

Instantly share code, notes, and snippets.

@dnsang
Last active February 22, 2018 13:43
Show Gist options
  • Save dnsang/8f17f6cc1f9b9f39368b to your computer and use it in GitHub Desktop.
Save dnsang/8f17f6cc1f9b9f39368b to your computer and use it in GitHub Desktop.
#search text in file in directory
grep -Ril "text-to-find-here" /
find . -name "*.txt" | xargs grep -i "text_pattern"
find . -name '*.py' -exec grep -n "text_pattern" {} \; -print
#understand xargs: find . -name "*.py" | xargs -n 1 echo
#sed
sed -i 's/test/test/g' file1.a
#awk:
http://code.linuxnix.com/2013/04/awk-scripting-learn-awk-built-in-variables-with-examples.html
awk -F’,’ ‘{print $4}’ db.txt
#Add New Application shortcut
vi /usr/share/applications/newitem.desktop
[Desktop Entry]
Version=1.0
Name=My Program
Exec=/home/danny/some/path/myprog/prog
Terminal=false
Type=Application
StartupNotify=true
Categories=Network;WebBrowser;
X-Desktop-File-Install-Version=0.15
Icon=/path/to/icon.ico
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment