From the course: Advanced Linux: The Linux Kernel

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Search the kernel source

Search the kernel source

- [Instructor] So you want to read Linux kernel source code. Good for you. That's a fun hobby. So searching through the source code, something you want to do to find where in the source code is a thing that you're interested in. Well, of course you can use grep. I often do a recursive grep, maybe a dash little I to ignore case, maybe a dash l just to get the names of the files to look in further. For example, if I was interested in sys_read, which turns out to be a function for doing reading, maybe I want to find a prototype, something like that. I could look in the include directory. So if I'm in the top level of the kernel source, I'm going to do grep -rl sys_read include, it will look in the include directory and everything underneath the include directory and report the path to any file that had the string sys read. And you know, maybe get about a half a dozen or so of those that you can go look at. What I frequently use, this is the classic way of looking at kernel source, is the…

Contents