Solved

Translation of command line arcana

Posted on 2003-11-21
2
269 Views
Last Modified: 2010-04-22
Hello,

A friend told me to run this on my linux box.

echo me.mo | tr oem fmr | sed 's#\.# -#;s/$/ \//' | sh

I think he's playing a prank on me, so I want to find out what it does.

The points are for (as best you can) a blow-by-blow translation of what's happening and what it means, as opposed to something general, like, "It's bad" or "It'll format your hard drive"

Thanks!
0
Comment
Question by:vlg
2 Comments
 
LVL 45

Accepted Solution

by:
sunnycoder earned 250 total points
ID: 9801744

>echo me.mo |
print string me.mo  ... but this string will not be printed due to | symbol ... it will be used as input to next command

>tr oem fmr |
replace all o with f e with m and m with r ... so you get rm.rf    .... | will pipe it into the next command

>sed 's#\.# -#;s/$/ \//' |
will convert it into rm-rf /

>sh
is nothing but starts a shell

... so you start a shell with rm -rf / ... to erase your / recursively without prompting (all directories)
0
 

Author Comment

by:vlg
ID: 9802511
Brilliant, genius, thank you, exactly what I wanted, sunnycoder -- you are the Man.

I must learn more about sed.  What a mess to look at.

Thanks again,

V
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question