You are not logged in.
Hi everyone. I'm looking for a concise list of useful commands to run incase something should happen to be going wrong somewhere (and also a 1-line for what they do)...the kind of output you'd post in a bug report. Some other good commands would help make "whats going on under the hood" more clear.
Also, if you have some useful directories (like /var/log), I'll take them too.
Current List (Thanks to all the posts below):
iwconfig, ifconfig | currently running wireless and overall link/state status.
dmesg | down/n/dirty low level system activity log
htop (non-built-in) | Process monitor
iftop, nethogs (non-built-in) | Bandwidth usage monitor
lsmod | Currently loaded modules
pstree | Currently running processes in a tree-text format
df -h | Hard drive space usage
ps -A -ao rss,comm | sort -rn | sed -n '1,5{s/^/\t/;s/ /\t/p}' | Top 5 ram hogs and how much
xsel -o -p | Clipboard monitoring (non-built-in)
xsel -o -b |
/var/log - looking for a log from a system process...probably here.
~/.XXXX - User installed programs house their config files here... ~/ = Your username's home directory. Equivalent to Application Data on Windows.
Last edited by dr/owned (2009-03-21 15:57:21)
Offline
dmesg gives the boot log. A quick look through it can reveal subtle mis-configurations, etc.
iwconfig gives wireless info, obviously. iwlist scan gives nearby networks.
Pretty much everything in /var/log/ can be very useful.
Offline
Any other useful commands to know for general "whats going on under the hood"?
Offline
most apps will have a verbose option
Offline
dmesg, iwconfig, ifconfig, iftop, htop, nethogs are all useful. /var/log.
I use this for a quick overview of my tcp+udp connections
#!/bin/bash
netstat -tpun |\
sed '1 d' |\
sort -t/ +1 |\
fgrep -v 'TIME_WAIT' |\
fgrep -v 'FIN_WAIT' |\
fgrep -v 'CLOSING' |\
fgrep -v 'LAST_ACK' |\
fgrep -v '127.0.0.1'
Last edited by Daenyth (2009-03-10 22:16:39)
[git] | [AURpkgs] | [arch-games]
Offline
Thanks Daenyth, iftop,htop,and nethogs aren't "default" Arch commands but now I know some more utilities I need to install.
Anything else...like if someone in a bug report were to say "this isn't working"...the most common response would be "post the output of [...]"...anymore [...]'s out there?
Edit: Woot, I found another one: lsmod - displays the currently loaded modules (useful for finding wasteful ones that should be blacklisted).
Last edited by dr/owned (2009-03-10 23:48:54)
Offline
strace command <-- for seeing what goes wrong
And these are all the commands that I want to see at all times on my computer:
pstree <-- processes in tree-view with concise threads display
ps -A -ao rss,comm | sort -rn | sed -n '1,5{s/^/\t/;s/ /\t/p}' <-- top 5 memory users (RSS=what this process really uses in RAM)
df -h <-- hard drive status
xsel -o -p
xsel -o -b <-- see what is in the clipboards
Offline
pstree is a really awesome one.
I laugh at ones like this: ps -A -ao rss,comm | sort -rn | sed -n '1,5{s/^/\t/;s/ /\t/p}' because I couldn't have come up with that or understand why it works in a million years
Offline
htop has a tree mode built in.
One tool that I just found this week is "mtr"; a combination of ping and traceroute in one command.. it's VERY cool.
Getting to know the /proc pseudo-filesystem is handy. Learn about the entries in /proc/$PID/, /proc/cpuinfo, /proc/partitions at least
Last edited by Daenyth (2009-03-17 00:45:40)
[git] | [AURpkgs] | [arch-games]
Offline
uname -r or -a | displays kernel/distro version
found a few more over here http://www.howtogeek.com/tag/linux/. I'm back in XP right now so I'll update my first post after I get home in a few days and test everything in Arch
Last edited by dr/owned (2009-03-21 15:54:16)
Offline
iotop is Definitely a good tool to check on whats taking hard drive resources.
Setting Up a Scripting Environment | Proud donor to wikipedia - link
Offline
ltrace -- strace-like, but shows library calls, not only system ones.
vmstat -- shows many essential system parameters at a glance, first tool to start investigating bottlenecks
lsof -- "list open files"; as network sockets, pipes, ... are all "files", there are many interesting informations to gather. But I use it for two purposes mainly: to identify file descriptors in strace/ltrace output and for finding deleted, but still open files eating disk space.
I like atop also, for its ability to show aggregated data, grouped by user or process name.
Offline
never leave home without it (youre supposed to run this before you expect something to fail obviously..) -- sudo tail -f /var/log/* (because i have no frickin idea what prog prints to what log file)
there's also something called inotail(inotify tail) but i haven't tried it.
Last edited by test1000 (2009-03-22 00:17:15)
KISS = "It can scarcely be denied that the supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of experience." - Albert Einstein
Offline
I just recalled lspci -nnvv from ubuntu. Need to make sure it's valid out of the box in arch cause it sure gives useful hardware info.
Offline
GNU screen needs a mention. Anyone using the cli more than trivially needs it.
[git] | [AURpkgs] | [arch-games]
Offline
...unless they're using dvtm and/or tmux
Offline
just a thought, I have the output of my /var/log/messages.log on my desktop using conky (great for troubleshooting and monitoring networking and volume mounting, just make sure your user is a member of the log group) , and much of the other information on another conky (Hard drive info, ram usage, ram hogs, cpu info etc.)
with this set up I have loads of useful information at a glance, updated in real time, right on my desktop.
Hofstadter's Law:
It always takes longer than you expect, even when you take into account Hofstadter's Law.
Offline
Someone posted output from top and iotop was also suggested. Haven't had time to fiddle with Arch recently though.
Offline
htop (non-built-in) | Process monitor
You should add plain old top to that line, since it's installed by default.
Offline
fdisk -l -- partition/hdd setup info
Offline