Added proc files such as /proc/meminfo, /proc/cmdline and commands like lsmod, modinfo, uptime

pull/218/head
Soham Chakraborty 2015-07-19 16:25:39 +05:30
parent 054a4659ed
commit b7d8200cc2
1 changed files with 8 additions and 6 deletions

View File

@ -97,6 +97,8 @@ Notes:
- Use `nohup` or `disown` if you want a background process to keep running forever.
- Know how long the system is running. Use `uptime` or `w` command and note the value in the third field of first row. That tells the current uptime of the system.
- Check what processes are listening via `netstat -lntp` or `ss -plat` (for TCP; add `-u` for UDP).
- See also `lsof` for open sockets and files.
@ -163,10 +165,6 @@ Notes:
- For general searching through source or data files (more advanced than `grep -r`), use [`ag`](https://github.com/ggreer/the_silver_searcher).
- To know the type of the file, use the eponymous file command. Like,
$ file vm_qa.py
vm_qa.py: a /usr/bin/env python script text executable
- To convert HTML to text: `lynx -dump -stdin`
- For Markdown, HTML, and all kinds of document conversion, try [`pandoc`](http://pandoc.org/).
@ -256,9 +254,9 @@ vm_qa.py: a /usr/bin/env python script text executable
- Know how to connect to a running process with `gdb` and get its stack traces.
- Use `/proc`. It's amazingly helpful sometimes when debugging live problems. Examples: `/proc/cpuinfo`, `/proc/xxx/cwd`, `/proc/xxx/exe`, `/proc/xxx/fd/`, `/proc/xxx/smaps`.
- Use `/proc`. It's amazingly helpful sometimes when debugging live problems. Examples: `/proc/cpuinfo`, `/proc/meminfo`, `/proc/cmdline`, `/proc/xxx/cwd`, `/proc/xxx/exe`, `/proc/xxx/fd/`, `/proc/xxx/smaps` (Where xxx is used to denote process id or pid)
- When debugging why something went wrong in the past, `sar` can be very helpful. It shows historic statistics on CPU, memory, network, etc.
- When debugging why something went wrong in the past, `sar` can be very helpful. It shows historic statistics on CPU, memory, network, disk activites etc.
- For deeper systems and performance analyses, look at `stap` ([SystemTap](https://sourceware.org/systemtap/wiki)), [`perf`](http://en.wikipedia.org/wiki/Perf_(Linux)), and [`sysdig`](https://github.com/draios/sysdig).
@ -444,6 +442,10 @@ A few examples of piecing together commands:
- `lshw`, `lscpu`, `lspci`, `lsusb`, `dmidecode`: hardware information, including CPU, BIOS, RAID, graphics, devices, etc.
- `lsmod`: List the currently loaded kernel modules.
- `modinfo`: Use `modinfo <module-name>` to get the details of a specific kernel module.
- `fortune`, `ddate`, and `sl`: um, well, it depends on whether you consider steam locomotives and Zippy quotations "useful"