Last active
December 28, 2015 19:08
-
-
Save AndrewRussellHayes/7547723 to your computer and use it in GitHub Desktop.
List of commands I find useful, changes over time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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