10 Useful Everyday Unix - LAMP commands

December 15, 2006 posted in tutorial, LAMP by admin


Here are 10 unix commands i use almost every day. I have googled all of them more than once so here they are in one place:

  1. find / -name “*.txt” -mtime 5
    Find all text files in filesystem modified in the last 5 days or last X days. replace -mtime as desired.
  2. sed ’s/^[ \t]*//’ inputfile > outputfile
    Flush all text in input file left into output file.
  3. dig www.roccanet.com
    Returns the ip address of name servers. Can also return any other DNS record - useful for transferring hosts or troubleshooting new sites.
  4. wget [option]… [URL]…
    An excellent download manager for HTTP protocol. Has many options like continuation of interrupted downloads and can mirror (read rip) an entire site. man wget for details.
  5. find / -name “*.htm” | xargs grep “http://www.roccanet.com”
    Find files of -name “xxxx” and then grep - search these files for string “http….” return list of matches (warning this can eat up processing resources - but sometimes necessary)
  6. sed ’s/^M//g’ inputfile > outputfile
    Remove ^M dos endlines from a unix file. dos2unix command also works here (among others)
  7. tar cvf tarball.tar .
    tar archive recursive for current directory. Always backup everything you do - i usually put this in a crontab to run nightly.
  8. wget -c http://www.google.com
    an HTTP commmand line download manager. Simple and powerful - can resume interrupted downloads and mirror a site. Man wget for more details
  9. sed -e ‘1,100d’ inputfile > outputfile
    Truncate lines 1 to 100 from inputfile and truncated result into outputfile. Remove lines 1 through 100 from file.
  10. tail -25 -f filename
    Tail follow the last 25 lines of a file as a stream (-f = follow option). Useful to monitor log files as they are written
  11.  

    tags:Technorati LAMP, tutorial.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Furl
  • del.icio.us
  • Reddit
  • Technorati
  • Slashdot
  • StumbleUpon
  • YahooMyWeb
Comments (0)


No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

— Next Page »
  • Categories:
    • Uncategorized
    • general
    • eBay
    • asia china seo
    • tutorial
    • online advertising
    • seo
    • click-fraud
    • LAMP
    • sitemaps
    • google
    • pc product recommendations
    • viral ad campaigns
    • stealth advertising
    • free worlwide phone calls

  • Archives:
    • September 2007
    • May 2007
    • April 2007
    • January 2007
    • December 2006
    • November 2006
    • October 2006
    • September 2006
    • August 2006
  • Meta:
    • Login
    • RSS
    • Comments RSS
    • Valid XHTML

Contact Roccanet
Copyright © Roccanet Inc. 2006 All Rights Reserved.
  • Home
  • Services
  • Blog
  • Login
  • Contact