Useful Linux Commands

  • How to find out mount/partition a directory or file is on?
    $df -P file/goes/here | tail -1 | cut -d' ' -f 1
    $df –h
  • Patch a diff
    $patch [-C] –I <diff filename>
  • List all process
    $ps -aux
  • List eclipse packages and uninstall
    $dpkg --get-selections | grep eclipse
    $apt-get purge eclipse*
    $rm -r ~/.eclipse/
  • Install Java 7
    $add-apt-repository ppa:webupd8team/java
    $apt-get update
    $apt-get install oracle-java7-installer
    $apt-get install oracle-java7-set-default
  • Autostart Samba Server
    $apt-get install sysv-rc-conf sysvinit-utils
    $sysv-rc-conf smbd on
  • Copy files with Progress
    $rsync -avh --progress sourceDirectory destinationDirectory
  • disk space for current directory
    $stat -c '%m' .
    $df -k
    $du / --max-depth=1 -h
Advertisements

ANTLR

ANTLR, ANother Tool for Language Recognition, is a language tool that provides a framework for constructing recognizers, interpreters, compilers, and translators from grammatical descriptions containing actions in a variety of target languages. ANTLR provides excellent support for tree construction, tree walking, translation, error recovery, and error reporting. There are currently about 5,000 ANTLR source downloads a month.

 

Interesting places