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 192.168.1.0/24
sudo apt-get install netdiscover
sudo netdiscover -r 192.168.1.0/24 -i wlan0

Monitor the memory usage

watch -n 5 free -h

Display opend ports

sudo lsof -i -P -n | grep LISTEN
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s