Skip to content

Instantly share code, notes, and snippets.

@adilmezghouti
Last active August 29, 2015 13:58
Show Gist options
  • Save adilmezghouti/9932354 to your computer and use it in GitHub Desktop.
Save adilmezghouti/9932354 to your computer and use it in GitHub Desktop.
Useful unix commands
#To check which programs are running on which ports
sudo lsof -i :80 # checks port 80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
haproxy 32850 root 4u IPv4 0xf27d639a63f41339 0t0 TCP *:http (LISTEN)
#To watch changes to a given folder
#To install this command on mac check out this link: http://osxdaily.com/2010/08/22/install-watch-command-on-os-x
watch -d ls -l
#Displays the file system disk space usage
df -k
uname -a
Darwin adil.local 13.1.0 Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64
#find filenames quickly
locate crontab
#changing the ulimit and starting mongo in the background
ulimit -n 2048 && sudo ./mongod --fork --logpath /var/log/mongodb.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment