LinuxCommand (1)
LinuxCommand (1)
www.cellstream.com
Note: Some commands require “sudo” in front for Administrator priviledges
Command Line Options
apropos whatis Show commands pertinent to string. See also threadsafe
man -t man | ps2pdf - > man.pdf Make a pdf of a manual page
which command Show full path name of command
time command See how long a command takes
time cat Start stopwatch. Ctrl-d to stop. See also sw
nice info Run a low priority command (The "info" reader in this case)
renice 19 -p $$ Make shell (script) low priority. Use for non interactive tasks
User Management
groupadd [name] Add a group with the appropriate name
useradd -c "User Name" - user Create a user named user with the comment User Name
usermod -aG support user Add the user account to the support group
Networking (Note ifconfig, route, mii-tool, nslookup commands are obsolete)
ethtool eth0 Show status of ethernet interface eth0
ethtool --change eth0 autoneg off speed 100 duplex full Manually set ethernet interface speed
ifconfig -a Display all interfaces and addresses
ifconfig etho Display networking details on eth0
iwconfig eth1 Show status of wireless interface eth1
iwconfig eth1 rate 1Mb/s fixed Manually set wireless interface speed
iwlist scan List wireless networks in range
who Who is logged onto the system
w Who is online and what they are doing
whoami Who are you logged in as
ip link show List network interfaces
ip link set dev eth0 name wan Rename interface eth0 to wan
ip link set dev eth0 up Bring interface eth0 up (or down)
ip addr show List addresses for interfaces
ip addr add 1.2.3.4/24 brd + dev eth0 Add (or del) ip and mask (255.255.255.0)
ip route show List IPv4 routing table
ip route add default via 1.2.3.254 Set default gateway to 1.2.3.254
tc qdisc add dev lo root handle 1:0 netem delay 20msec Add 20ms latency to loopback device (for testing)
tc qdisc del dev lo root Remove latency added above
host pixelbeat.org Lookup DNS ip address for name or vice versa
hostname Display the host name of the system
hostname -i Lookup local ip address (equivalent to host `hostname`)
hostname -I Look up network IP address
ping [hostname] Send echo request/reply to hostname or ip address
whois pixelbeat.org Lookup whois info for hostname or ip address
dig [domain] Display domain information for [domain]
dig -x [ip address] Reverse lookup of ip address
netstat -tupl List internet services on a system
netstat -tup List active connections to/from system
tcpdump -I eth0 Capture and display all packets on interface eth0
tcpdump -I eth0 'port 80' Capture all traffic on port 80 (HTTP)
tcpdump not port 22 Show network traffic except ssh. See also tcpdump_not_me
wget http://domain.com/file Download the file at the URL
Windows/Samba Networking
smbtree Find windows machines. See also findsmb
nmblookup -A 1.2.3.4 Find the windows (netbios) name associated with ip address
smbclient -L windows_box List shares on windows machine or samba server
mount -t smbfs -o fmask=666,guest //windows_box/share /mnt/share Mount a windows share
echo 'message' | smbclient -M windows_box Send popup to windows machine (off by default in XP sp2)