Linux commandline tips: Difference between revisions

From www.ReeltoReel.nl Wiki
Jump to navigation Jump to search
No edit summary
Line 56: Line 56:
=AutoYast=
=AutoYast=
create autoyast file through icon in Yast2->autoyast
create autoyast file through icon in Yast2->autoyast
www.suse.de/~ug (Uwe Gansert)
www.suse.de/~ug (Uwe Gansert)

Revision as of 07:06, 14 May 2009

lsof

lsof list open files
lsof -i :22 list all ssh connections (same :ssh)
lsof -i@10.0.0.1 list all connections from 10.0.0.1
lsof -i@amsterdam.nl list all connections from domain
lsof -u username list all open files from username
lsof -c bash list open files related to bash
lsof -c /log/ list all open files from all processes containing log

iperf

iperf -s -w128k run server for performance benchmark
iperf -c <serveraddress> -w128k -t30 -r run client
iperf -c <serveraddress> -w128k -t30 -d run client in two directions, full duplex

pstree

pstree -a shows processes tree structure with program's parameters
pstree -h highlights own process 
pstree -H <id> highlights process id
pstree -u shows user

kill

kill -l shows instructions

 1  SIGHUP restart immediately after terminating
15  SIGTERM request to terminate and cleanup
 9  SIGKILL force terminate
19  SIGSTOP interrupts the process until you enter SIGCONT to continue
kill -19 9102 10234 stops several processes
killall -19 ssh sends all ssh connections to sleep
killall -19 -i ssh interactive mode (recommended)

pgrep

pgrep ssh lists all ssh processes
pgrep -l ssh shows names
pgrep -f  shows full commandline
pgrep -u show user

pkill

understands the same options as pgrep

pkill -19 ssh
pkill -19 -u joop stop joop's processes

zombies

ps aux | grep defunct

free

free -m

watch the line with +/- buffers: free indicates memory that can be freed instantaniously used is all memory being used

tune kernelparameters

stored in /proc/sys/ gone after reboot

sysctl is a service that reads sysctl.conf during boot and read parameters from there -> makes it permanent

AutoYast

create autoyast file through icon in Yast2->autoyast

www.suse.de/~ug (Uwe Gansert)