Linux Commnads

Some useful Linux commands.
This article will be updated with new commands.

Restore normal functioning of modifier keys

setxkbmap -model pc102 -layout us_intl

Stop a process by command name
Command name in this example is ‘npviewer.bin’

for name in $(ps ux | awk '/npviewer.bin/ && !/awk/ {print $2}'); do kill "$name"; done

Show current Linux distribution

cat /etc/issue

DNS clear/flush

sudo apt-get install nscd
sudo /etc/init.d/nscd restart

List directory space

du --max-depth=1 -h

Find all the used IP addresses on a network

sudo apt-get install nmap
nmap -sn
sudo apt-get install netdiscover
sudo netdiscover -r -i wlan0

Monitor the memory usage

watch -n 5 free -h

Display opend ports

sudo lsof -i -P -n | grep LISTEN

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.