CA BD NY
  • Categories

  • Recent Posts

  • RSS MySQL Hacker

  • RSS Apache Hacker

    • An error has occurred; the feed is probably down. Try again later.
  • RSS Editor's Lists

    • An error has occurred; the feed is probably down. Try again later.
  • Meta

  • Cheat Sheet

    Disk Related Commands

    # Find disk usage by partition in a human readable format
    $ df -h
    
    # Find the top 100 space eating monster file/dir under a directory
    $ du -a [dir] | sort -n | tail -100
    

    Security Related Commands

    # Find out what files a logged in user has opened (ignoring libs, devices, sockets, pipes)
    $ lsof | grep [username] | egrep -v '(lib|/dev|pipe)'
    
    # Find which process is connected to what port and which remote host
    $ netstat -pat
    

    Network Related Commands

    # Find the NIC speed
    $ mii-tool
    

    File/Dir Commands

    # Move all files with specific pattern to a sub-directory which might already have files with same pattern
    $ find . -maxdepth 1 -name "*2008*.txt" -exec mv {} 2008 \;