Find who is logged on and What they are doing
$ w
10:11:28 up 14 days, 2:33, 1 user, load average: 0.00, 0.00, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
asis pts/0 XXX.XXX.XXX.XXX 10:11 0.00s 0.05s 0.01s w
Kill tty Connections
$ pkill -9 -t <TTY>
# Example
$ pkill -9 -t pts/0
Find Common Elements Between Two Lists
comm
is great, but indeed it needs to work with sorted lists.
$ comm -12 <(ls one) <(ls two)
Alternative with sort
:
# Intersection of two lists:
$ sort <(ls one) <(ls two) | uniq -d
# Symmetric difference of two lists:
$ sort <(ls one) <(ls two) | uniq -u
reflector
$ curl "https://asispatra.github.io/vault/reflector" -o reflector
$ sudo mv reflector /usr/local/bin/
$ sudo chmod a+rx /usr/local/bin/reflector
# Usage
$ reflector <FILENAME> <NEW_FILE_NAME>