Login
Forgot Password?

OR

Login with Google Login with Twitter Login with Facebook
  • Join
  • Profiles
  • Groups
  • SuicideGirls
  • Photos
  • Videos
  • Shop
Vital Stats

baudot

Oakland, CA

Member Since 2004

Followers 451 Following 294

  • Everything
  • Photos
  • Video
  • Blogs
  • Groups
  • From Others

Wednesday Nov 02, 2011

Nov 1, 2011
0
  • Facebook
  • Tweet
  • Email
I <3 2> /dev/null

SPOILERS! (Click to view)
.
What language is this?

This is a phrase in bash. Bash is the command language under the hood of macs and most web servers. Specifically, this is a suffix you'd tack on after another command.

What does it say?

">" redirects output from that command somewhere else. Adding the 2 on front only grabs part 2 of the output - the errors.

/dev/null is nowhere. It's a black hole.

So this is a phase we tack onto a mac command under the hood to ignore error messages. (Literally, to redirect error messages into the void.)

Tacking this onto the end of a command strips out the crap error messages flooding your results and leaves the success lines you were searching for. And I <3 that.

Tonight I'm searching a stranger's code to figure out why an event that I want to happen isn't happening. So I'm running a lot of commands like this:

grep -n "FROM LoginInfo" `find ./ -name "*.j*"` 2> /dev/null



grep is the "Global Regular Expression Parser". It's an all purpose search command. I'm using it to look for the text "FROM LoginInfo". The -n bit tells it that I also want to know the line number whenever it finds that text in a file.

The next part is telling it where to look. grep commands normally look like:
grep <what> <where>
In this case, I've got another command within backticks in the where slot:
`find ./ -name "*.j*"`

The backticks say, take this command, and use it's output in this spot.

I'm using the find command to list every file that has a 'j' in the last part of it's name, from this directory on down.

So, in full, the command:

grep -n "FROM LoginInfo" `find ./ -name "*.j*"` 2> /dev/null


translates to:

Find everywhere that "FROM LoginInfo" appears in any file with a j in its name from this directory on down. Tell me what line number you found it on, too, and don't bother me with all the places you couldn't find it.



Why is that awesome?
Screw the haystack. Here's the needle I'm looking for, in 0.2 seconds.

More Blogs

  • 10.06.13
    35

    New Site, eh?

    Well, the new version of SG looks basically good. Biggest change I…
  • 10.02.13
    8

    Wednesday Oct 02, 2013

    This year has been intense for reality surpassing the science fiction…
  • 09.22.13
    10

    Sunday Sep 22, 2013

    Read More
  • 09.01.13
    25

    Monday Sep 02, 2013

    What companies are doing stuff that excites you? It's time for a n…
  • 08.17.13
    10

    Saturday Aug 17, 2013

  • 07.19.13
    19

    Saturday Jul 20, 2013

    3 Days in Shenzhen
  • 07.11.13
    11

    Thursday Jul 11, 2013

    I'm headed to Shenzhen, China in a couple hours. This should be fun.
  • 07.10.13
    12

    Wednesday Jul 10, 2013

    Heads up: I just cleaned out a dozen or so folks from my friends-list…
  • 07.03.13
    6

    Wednesday Jul 03, 2013

    Today, while rushing-about-no-time-to-spare, I have consumed: Two mu…
  • 06.25.13
    6

    Tuesday Jun 25, 2013

    Grooving out to: Daft Punk covered on the banjo

We at SuicideGirls have been celebrating alternative pin-up girls for:

23
years
9
months
12
days
  • 5,509,826 fans
  • 41,393 fans
  • 10,327,617 followers
  • 4,593 SuicideGirls
  • 1,119,563 followers
  • 14,922,778 photos
  • 321,315 followers
  • 61,398,461 comments
  • Join
  • Profiles
  • Groups
  • Photos
  • Videos
  • Shop
  • Help
  • About
  • Press
  • LIVE

Legal/Tos | DMCA | Privacy Policy | 18 U.S.C. 2257 Record-Keeping Requirements Compliance Statement | Contact Us | Vendo Payment Support
©SuicideGirls 2001-2025

Press enter to search
Fast Hi-res

Click here to join & see it all...

Crop your photo