#Question regarding finding stuff terminal.
14 messages · Page 1 of 1 (latest)
Actually you won't be able to find the exact text within the file as the file has been updated but um just want to know how you'd do it
Confusion 🥲
if it's a text file out of many, u could probably cd to its folder, and do ls | grep "dog"
if u were looking for a file that had mention of dog
or cat suspectfile.txt | grep "dog"
(cat means concatenate, but it usually used to just show/type text files to the screen)
or just to filter file results, u can filter file names... ls dog*
if there were 100 file starting with dog among 1000 files in the folder
or ls *dog* for any file having dog somewhere in the name with that lettercase
see grep --help for more info, i may have not got it right
Wait this is within the folder right like if a folder had 1000 text files and maybe 47 of them are "dog" you can list them up but my question is within a file if there are n number of lines and I need to find "dog" but only using head, tail, grep and cat. Like need to know the line number too
But appreciate the help