I'm currently learning Linux, and some of the practice I've has me absolutely stumped. I'm trying to look for a file in the current directory with particular text, and output its inode number. I can confidently do all these things individually but it keeps falling apart when I try to put them together;
find. -maxdepth 1 -type f | grep -r "#include" -ls -i
but for some reason it just outputs the file names?
Any ideas?
find . -maxdepth 1 -type f | grep -r "#include" | ls -i
bring you any closer to what you are looking for?maxdepth
is not important, you can just dogrep -r
to recursively search the directory. If it is, useexec
withfind
as in the 1st answer.