Find the PTS connection number of the logged in user that you wish to kick:

zero_serv:~ # who
root tty1 Sep 19 08:13
root pts/0 Jan 18 12:59 (10.69.52.125)
root pts/1 Jan 18 13:07 (10.69.52.183)

In this example, we want to kick the ‘root’ user that is on ‘pts/1′. (Notice that the connections are labeled by IP)

Issue the command:

zero_serv:~ # ps x | grep ssh
2973 ? Ss 0:00 /usr/sbin/sshd -o PidFile=/var/run/sshd.init.pid
8006 ? Ss 0:00 sshd: root@pts/0
8068 ? Ss 0:00 sshd: root@pts/1
8176 pts/0 R+ 0:00 grep ssh

(Note: depending on the system, you may need to issue this: ps -aux | grep ssh)

As you can see above, PID 8068 is the culprit.

Issue the command:

zero_serv:~ # kill -9 8068
(Where 8068 is your PID)

The session will now be killed.

As with the Cisco commands, I normally forget commands. This is just a reference of some commands.

Read scsi devices, memory, cpu
cat /proc/scsi/scsi
cat /proc/meminfo
cat /proc/cpuinfo

top

echo "- - -" > /sys/class/scsi_host/hostX/scan
X stands for the SCSI bus to scan

cat /sys/class/scsi_host/hostX/proc_name
X stands for the SCSI bus to list

SCSI device information
scsiinfo -l

Find files less than a day old:
find . -type f -mtime -1

Find files modified more than a day ago
find . -type f -mtime 1

Hardware info
hwinfo more | grep

Disk space (human readable sizes)
df -h

Update timeserver
ntpdate -u time.timeserver.com

OES version
cat /etc/novell-release

SLES version
cat /etc/SuSE-release

Folder size
du -sk DirName

Hardware serial number (Use on Dell/HP servers – probably others)
dmidecode|grep "Serial Number"

These are commands that I use on occasions, but always seem forget.

show int phy-id (see stats of port)
show arp (show current switch ip)
show int trunk
show mac-address-table
show mac-address-table address 0000.1111.2222
show vlan
show cdp neighbors detail
show cdp neighbor PORTNAME detail
show switch (list switches in stack)

From TFTP:
copy tftp: running-config
To TFTP:
copy running-config tftp:

SCP is great for transferring files between linux boxes.

Example commands:

Copies files from a remote server to the local machine:
scp root@server.com:/home/zerowizard/copy_me.txt /home/andrew/copy_me.txt

Copies files from local machine to a remote server:
scp /home/andrew/copy_me.txt root@server.com:/home/zerowizard/copy_me.txt

-p Preserves the modification and access times, as well as the permissions of the source-file in the destination-file
-q Do not display the progress bar
-r Recursive, so it copies the contents of the source-file (directory in this case) recursively
-v Verbose mode for viewing debugging messages
-P Specifies port used
-q Quiet mode: disables progress meter as well as warning and diagnostics messages.
-l Limits the used bandwidth, specified in Kbit/s
-C Compression enable
-c Change the enycrption cipher. (common values: 3des (default), blowfish, des)

This command is useful to find out if any pairs are open. Just connect a device to the other end, and run the command:

Switch#test cable-diagnostics tdr interface g1/0/2
TDR test started on interface Gi1/0/2

It may take a few seconds to run. Then issue the following command:

Switch#show cable-diagnostics tdr interface gigabitEthernet g1/0/2
TDR test last run on: Oct 12 07:12:12

You should see some results like the following:

Interface    Speed    Local pair    Pair length    Remote pair    Pair status
---------    ------   ----------    -----------    -----------    -----------
Gi1/0/2        auto     Pair A        22 +/- 4 m         N/A       Open
Pair B        21 +/- 4 m         N/A       Open
Pair C        5 +/- 4 m          N/A       Open
Pair D        20 +/- 4 m         N/A       Open