Common UNIX commands

find/search

find . -name "rc.conf" -print

http://www.athabascau.ca/html/depts/compserv/webunit/HOWTO/find.htm

Recursively find files with certain contents limited to file type
grep -r --include=*.java "stringtofind" .

Memory usage

List processes and their memory

ps -eo size,pid,user,command --sort -size | awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }'

Free memory

free


Subversion

This will remove all .svn folders in the current directory and below
find . -name .svn -print0 | xargs -0 rm -rf

This will add a folder without its descendants (non recursively)
svn add --depth=empty folder1/folder2

Add all unknown files
svn status | grep "^?" | awk '{print $2}' | xargs svn add


tar

To extract the contents of a tar file use:
tar xvzf foo.tgz

Compress a dir to archive:
tar -cvzpf archive.tgz /home/example/public_html/folder


df

Human readable free space
df -h


Apache + Ubuntu

Enable modules
sudo a2enmod


Macports

PostgreSQL


sudo vi /opt/local/var/db/postgresql84/defaultdb/pg_hba.conf

sudo /opt/local/etc/LaunchDaemons/org.macports.postgresql84-server/postgresql84-server.wrapper start
sudo /opt/local/etc/LaunchDaemons/org.macports.postgresql84-server/postgresql84-server.wrapper stop


MySQL

sudo /opt/local/share/mysql5/mysql/mysql.server start


Java

Run VisualVM:
/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin/jvisualvm

About Humanise

We focus on user experience and design. We seek out the most simple and essential solution. We believe that machines should work for people. We think that knowledge should be free and accessible to all. We hope you agree :-)

More about Humanise »

Contact

Jonas Brinkmann Munk

jonasmunk@mac.com · +45 28 77 63 65

Kenni Graversen

gr@versen.dk · +45 22 48 61 53

hand