--- title: Finding Things linkTitle: Finding Things type: docs weight: 5 aliases: - /manuals_linux-basics_finding-things.html - /manuals_linux-basics_finding-things --- ## Find Files ```bash find ~ -name "*pattern*" # Searches for *pattern* in and below your home directory find ~ -iname "*pattern*" # Same as above, but case insensitive find ~ -type f -mtime -2 # Searches for files you have modified in the last two days ``` Useful `find` arguments: * `-user ` * `-group ` * `-ctime ` * `-exec {} \;` ## Find Text ```bash grep "pattern" # Provides lines in a file where "pattern" appears grep -H "pattern" # -H prints out file name in front of pattern find ~ -name "*.txt" -exec grep -H "pattern" {} \; # Search lines where "pattern" appears in files with names that end with ".txt" ``` ## Find Applications ```bash which # Location of application whereis # Searches for executables in set of directories rpm -qa | grep "pattern" # List all RPM packages and filter based on "pattern" ```