Skip to content

Instantly share code, notes, and snippets.

@AndrewRussellHayes
Last active December 28, 2015 19:08
Show Gist options
  • Select an option

  • Save AndrewRussellHayes/7547723 to your computer and use it in GitHub Desktop.

Select an option

Save AndrewRussellHayes/7547723 to your computer and use it in GitHub Desktop.
List of commands I find useful, changes over time
#grep recursively
find . -type f -exec grep -n "stuff" {} \; -print
#count files in directory
ls -1 <targetdir> | wc -l
#put contents of one file at end of another
cat ./this-file >> ./into_this-file
# remove results of ls
rm `ls | grep -v NOTTEST`
#find command
#NOTE there must be a trailing / after the file path to search recurisvely if the / is left off the end the search will only look in that folder i believe.
find / -name foo > results.txt
# dding 2>/dev/null to the end ignores cannot read dir errors
find / -name *CECOM* > CECOMsearchResults.txt
find / -name *cecom* > CECOMsearchResults2.txt 2>/dev/null
find /data/data/BFH/ -name *1RL7* > 1RL7searchResults.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment