Is there any common directory to find kernel file in all Linux distributions?if yes please tell me how to browse to the directory?
Where can I find the Linux file in Ubuntu & RedHat operating systems?
Asked
Active
Viewed 1e+01k times
27
Sathyajith Bhat
- 61,504
- 38
- 179
- 264
BlueBerry - Vignesh4303
- 8,129
- 22
- 68
- 99
1 Answers
23
There no universal standard, but the kernel is usually found in the /boot directory.
David Schwartz
- 61,528
- 7
- 100
- 149
-
i found the directory and it lists many files may i know which is main kernel file? – BlueBerry - Vignesh4303 Aug 17 '12 at 08:14
-
2You can use `uname -r` to find out the version you're running and then look for a file in `/boot` with that name. You can also use `cat /proc/cmdline` to find the kernel path, but note that this path is relative to the root image at boot time, so `/` likely means `/boot/` in the running system. – David Schwartz Aug 17 '12 at 08:17
-
1The path that the kernel reports that it was loaded from is relative to the root as it was at the time the kernel was loaded. That's probably called `/boot` by the time the system is fully loaded. (After the kernel has been booted, the root is "pivoted" to the normal root and the boot time root is usually called `/boot` in the run-time filesystem.) – David Schwartz Aug 17 '12 at 08:23
-
6Using cat /proc/cmdline is a better method because if you use the uname -r you will not be able to tell the difference between that kernel image or a rescue image built from the same kernel version. – Nov 15 '15 at 20:16
-
Thanks for the answer. I found "/lib/modules/
/kernel" folder in my Ubuntu 18.04 OS computer. Does it also contain the information of kernel? – Cloud Cho Oct 27 '22 at 23:05