Finding files in your home directory is very easy. The command below will search inside all files in your home directory and find all files that contain the text “linux”.
find . -type f -exec grep -niH linux '{}' ';' |
This is a good example of usage.
┌──[jason@192.168.1.2]─[~] └──╼ ╼ $ find . -type f -exec grep -niH linux '{}' ';' ./Desktop/bandcamp-dl-master/README.rst:20:Some linux distros may require that python3-pip is installed first. ./Desktop/bandcamp-dl-master/bandcamp_downloader.egg-info/PKG-INFO:28: Some linux distros may require that python3-pip is installed first. Binary file ./.googleearth/Cache/qwebdata/general/data8/2/9061yapr.d matches Binary file ./.googleearth/Cache/qwebdata/general/data8/6/26xrsnyv.d matches Binary file ./.googleearth/Cache/qwebdata/general/data8/a/2fc2cpyj.d matches Binary file ./.googleearth/Cache/qwebdata/general/data8/a/2y38467z.d matches Binary file ./.googleearth/Cache/qwebdata/general/data8/9/2f9g3sby.d matches Binary file ./.googleearth/Cache/qwebdata/general/data8/9/k6uvsaay.d matches Binary file ./.googleearth/Cache/qwebdata/general/data8/d/2hc16n5m.d matches Binary file ./.googleearth/Cache/qwebdata/general/data8/5/12t1q3b5.d matches Binary file ./.googleearth/Cache/qwebdata/general/data8/5/ypvz5tne.d matches Binary file ./.googleearth/Cache/qwebdata/general/data8/5/1qcelsn5.d matches Binary file ./.googleearth/Cache/qwebdata/general/data8/f/24eh27ro.d matches Binary file ./.googleearth/Cache/qwebdata/general/data8/1/34jtusaq.d matches ./Fedora/.bashrc:59:# These following functions from http://www.die.net/doc/linux/abs-guide/sample-bashrc.html ./Fedora/.bashrc:134:if [ "$TERM" == "linux" ]; then ./Fedora/.bashrc:144:# The following code from http://www.die.net/doc/linux/abs-guide/sample-bashrc.html ./Fedora/screen.dump:6:Debian GNU/Linux 9 debian tty1 ./Fedora/screen.dump:11:Linux debian 4.9.0-4-amd64 #1 SMP Debian 4.9.65-3+deb9u1 (2017-12-23) x86_64 ./Fedora/screen.dump:13:The programs included with the Debian GNU/Linux system are free software; ./Fedora/screen.dump:17:Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent ./Fedora/dump.out:6:Debian GNU/Linux 9 debian tty1 ./Fedora/dump.out:11:Linux debian 4.9.0-4-amd64 #1 SMP Debian 4.9.65-3+deb9u1 (2017-12-23) x86_64 ./Fedora/dump.out:13:The programs included with the Debian GNU/Linux system are free software; ./Fedora/dump.out:17:Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent Binary file ./Fedora/virtio-win.iso matches |
The ack utility is very useful for finding text within files.
Install it like this.
┌──[jason@192.168.1.2]─[~] └──╼ ╼ $ sudo apt install ack |
Then use it to find any text you are looking for.
┌──[jason@192.168.1.2]─[~] └──╼ ╼ $ ack "linux" Desktop/bandcamp-dl-master/README.rst 20:Some linux distros may require that python3-pip is installed first. Desktop/bandcamp-dl-master/bandcamp_downloader.egg-info/PKG-INFO 28: Some linux distros may require that python3-pip is installed first. Fedora/.bashrc 59:# These following functions from http://www.die.net/doc/linux/abs-guide/sample-bashrc.html 134:if [ "$TERM" == "linux" ]; then 144:# The following code from http://www.die.net/doc/linux/abs-guide/sample-bashrc.html Downloads/swap_digger/swap_digger.sh 109: # Looking for linux account passwords (ubuntu)wc -l 116: out " [+] Digging linux accounts credentials... (pattern attack)" 140: out " [+] Digging linux accounts credentials method 2 ... (dictionary attack)" 171: out " [+] Digging linux accounts credentials method 3... (John attack)" 172: out " [+] Cracking linux account passwords using John." Downloads/SpaceX/Geminilake_SIC/GeminilakeFspPkg/BuildScripts/CommonHelperFunctions.py 206: elif sys.platform.startswith('linux'): 207: # If this running on linux, run the exe with wine Downloads/Create a bootable USB drive/Writing to USB flash drive UltraISO/UltraISOPortable/App/UltraISO/History.txt 74: +) Improved syslinux V5/V6 support, can create more bootable USB disk from 109: +) Improved syslinux V3/V4 support, can create bootable USB disk from 110: ISO image of popular linux distributions, including: 126: +) Improved syslinux V4 support, works for wrting bootable USB disk 135: +) Supports syslinux V4 boot sector 207: *) Keeps graphics menu on writing isolinux/syslinux based bootable UFD's 219: *) Improved bootable linux USB disk creation (knoppix/ubuntu) 225: local harddisk (MS-DOS, WinPE, or isolinux/syslinux based systems) 228: +) Supports bootsector of DOS(MSDOS/PCDOS/FREEDOS), Windows NT and syslinux 728: *) Fix a bug with 'boot catalog' file for some Unix/linux bootable CDs Downloads/NOTREPACKED/nt5src/XPSP1/tools/x86/perl/lib/pod/perlembed.pod 104: -I/usr/local/lib/perl5/i586-linux/5.003/CORE 105: -L/usr/local/lib/perl5/i586-linux/5.003/CORE |
This highlights the matching text and which line it is on. This is a very useful utility for searching source code to find various strings.
This is a nice example. Searching the Windows XP source code.
┌──[jason@192.168.1.2]─[~/Downloads/NOTREPACKED/nt5src/XPSP1] └──╼ ╼ $ ack "virus" tools/x86/perl/lib/pod/perlfaq3.pod 447:viruses, or bootleggers. The real advantage of the compiler is merely tools/waitproc.pm 114: #####Free slot from depending command - virus scan tools/publicchanges.txt.1 559:internal\ds\lib\*\winsafer.lib, add, jlawson, WinSafer code authz virus sandbox API 1455:sdk\inc\winsafer.h, add, JLawson, WinSafer code authz virus sandbox API ds/security/cryptoapi/pki/activex/xenroll/how2sign.txt 5:2. use a virus checking tool to run on dlls and symbol files (I use Cheyenne Innoculan), see http://prslab ds/security/cryptoapi/pki/activex/release/xenroll/xerel.cmd 141:REM scan virus here 143:echo scanning virus... 149:echo Finished virus checking on %xe_dll% 150:set /p xe_goon=Is virus checking OK?(y/n): ds/security/cryptoapi/pki/activex/release/scrdenrl/screl.cmd 96:REM scan virus here 98:echo scanning virus... 104:echo Finished virus checking on %xe_dll% 105:set /p xe_goon=Is virus checking OK?(y/n): ds/security/cryptoapi/pki/activex/capicom/release/how2sign.txt 12:3. Use a virus checking tool to run on dlls and symbol files (I use Cheyenne Innoculan), see http://prslab. |
So, this is a very useful utility.