Saturday, February 01, 2014

SSH Handy Shortcuts

File/Disk Browsing
Lists summary size (-s) in Gb/Mb/Kb (-h) units for all sub-directories of the current path (./*)
# du -sh ./*

Show everything, human readable file sizes, in a list
# ls -lah


Pipes
Use the | after the first command to pipe the output to the next command e.g. Show all processes with the string apache in the command
#ps | grep apache

Screen
Is a pretty handy tool if you do much work via an SSH terminal

Launch app
# screen

Detach current screen
Ctrl-a d

List screens running
# screen -ls

Reattach a single screen
# screen -R

TCP/IP
# ifconfig
# sudo iwlist wlan0 scan