Users should be computer-friendly, instead of computers being user-friendly!

Linux Command-Line Memes Explained

Date/Time Permalink: 06/26/07 09:45:43 am
Category: LINKS and Lists

You've seen these many times, in chats, comments, and discussion posts online. Particularly Unix system admins, but also plain old regular Linux users, tend to use these command-based memes conversationally. Such is the power of Unix command-line syntax, that it's often handy to adopt a convention into your day-to-day speech!

For the mystified, here's a little cheat sheet. With rare exceptions, you'll find these always written, never spoken.

s/foo/bar/ - The sed command takes this string to mean "substitute foo with bar".
Usage: Very common and useful.
Example: Use it to 'correct' a typo in your last message: "s/lkie/like/" or as a joke to 'say what you really mean': "I find your comments interesting. s/interesting/berzerk/"

$THING - This is how you use a variable in Bash. The $ is necessary; upper-case letters are a convention.
Usage: Very common and useful.
Example: Use it to designate any random member of the set: "You could do that on Linux, BSD, or any other $UNIX" "We'll see after $CANDIDATE is elected." Or use it to make it clear that you don't want to use a proper noun for libel reasons: "When I worked at $BIG_FINANCIAL_CORPORATION..."

ln -s foo bar - The "ln" program creates a softlink with the -s option, creating an alias "bar" for another file "foo", much in the same way you'd create a desktop shortcut in Windows.
Usage: Unusual, but useful. Sometimes humorous.
Example: A way to indicate that you consider one thing to be a good substitute for another. "Would you use Java to do a solitaire game on Linux?" "Sure I would! ln -s Python Java" "Did your promotion to manager make a difference?" "Not really. ln -s peon manager"

/me action - This is an IRC chat meme rather than a Unix one, but so many Unix system users have a background on IRC that it's almost synonymous. /me makes your user name substitute on the line; the rest of the text shows you performing an action. "/me greets you" for user John shows up as "John greets you"
Usage: Very common and almost always silly.
Example: Designate an action: "/me waits for explanation." Sometimes you'll see some other action performed: "/egg Eric" means you are figuratively chucking an egg at user Eric.

tar -xzf foo - Tar is an archive manager on Unix, and adding the option -z makes it unzip as well. This command is equivalent to opening a large archive file, like "unzip foo" on DOS (zip and unzip work in Unix too, by the way).
Usage: Very rare, usually silly.
Example: Use as a synonym for unpacking and putting away: "After I got home from the store and tar -xzf the groceries..." "On Christmas morning we tar -xzf the presents."

apt-get install foo - Apt-get is the most popular package manager on Linux systems, to the point where even users of systems that don't use apt-get know this meme. It is how you install, uninstall, upgrade, and manage software packages. The difference from tar (above) is that you're installing a program, as opposed to opening a set of files for your own use.
Usage: Very common, almost mainstream. Useful or silly.
Example: Many practical situations: "I got a new girlfriend." = "apt-get install girlfriend" "I traded in my old car and got a new one." = "apt-get upgrade car" "I threw out my VCR." = "apt-get uninstall VCR"

kill -9 thing - Unix systems have a kill command, used to forcibly shut down a program that's not responding. Similar to how you'd Ctrl-Alt-Del to get the process manager in Windows and then click a program and shut it down. The -9 option isn't always necessary, but you'll see it appended as an "extra measure" anyway.
Usage: Common, somewhat silly.
Example: Use it as a metaphor for terminating or shutting something down: "How do you feel about the TV news coverage of Paris Hilton?" "kill -9 TV set." "Trolls have taken over this thread, time to kill -9 it."

grep foo bar - Grep is the Unix command to search within a file for a word or line. Think "Google for your files." The command "grep thing ./*" would search every file in the current directory for the word 'thing'.
Usage: Very common, almost mainstream. Useful or silly.
Example: Use it as a metaphor for any search. "I'm checking the classified ads for a new job." = "grep job newspaper" "I can't find my car keys - I'll have to grep keys house." Unlike these other examples, grep is easily spoken and so you can find yourself using "grepping" in conversation as a synonym for "Googling".

~ - The mighty tilde is a command-line shortcut for your home directory. Instead of saying "/home/you/my_files/" you'd say "~/my_files".
Usage: Common and useful.
Example: Just use it for a synonym for your home! "I'm ~." "I'm cd ~" means "I'm going home." since cd is the Unix (and DOS) command for "change directory".

Note that I'm not trying to replace the Jargon File here; these are just small-change memes not completely covered by the Jargon File which non-Linux users are likely to see Linux (or other $UNIX) users batting around on Slashdot, Digg, or text chat. We don't use these to be deliberately obscure; some of these really do save a lot of time and make a handy substitute for a much longer, more literal explanation.

Follow me on Twitter for an update every time this blog gets a post.
Stumble it Reddit this share on Facebook

suddenly the moon