+16 16 0
Published 8 years ago by caelreth with 3 Comments

Join the Discussion

  • Auto Tier
  • All
  • 1
  • 2
  • 3
Post Comment
  • idlethreat (edited 8 years ago)
    +4

    one command soundly missed is apropos. Need to do something, but don't happen to know it's exact name? Well, then. It's time for apropos!

     MacBook-Pro:~ admin$ apropos download
     CPAN(3pm)                - query, download and build perl modules from CPAN sites
     lwp-download(1)          - Fetch large files from the web
     Wget(1)                  - The non-interactive network downloader
     git-fetch(1)             - Download objects and refs from another repository
     git-http-fetch(1)        - Download from a remote Git repository via HTTP
     MacBook-Pro:~ admin$
    

    works on Linux and OSX and it's saved my ass more than once time over the years whenever I knew there was a command to do something, but couldn't think of what it was.

  • robie1373
    +2

    I spend so much time running find with the -name and -exec switches is silly. Syntax is a bit funky but once you get a handle on it, there isn't much you can't do. ~ # find . -name foo -exec "cat {} >> ~/bar.txt" \; [read all the file under the current directory who's name matches (regex) foo and write their contents into a file named bar.txt in your home directory.]

    Also grep. ~ # grep -r monkey / [search inside every file under / for text matching "monkey" and print out the matching line]

    These are from memory, (I'm at a winows box right now) so I apologize if there are errors in the examples. To hedge here is a bonus tip.

    Bonus: try -h or --help switches to pretty much any command for a quick reminder of how it works. Save that brain real estate for more important things than memorizing switches!

Here are some other snaps you may like...