?
Solved

Translation of command line arcana

Posted on 2003-11-21
2
Medium Priority
?
273 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 45

Accepted Solution

by:
sunnycoder earned 1000 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

DFW AZURE MEETUP TONIGHT FRI 6PM

We will be discussing what Azure Stack is, how does it fit into the suit of offerings that Azure has currently, and where can it fit into your organizations technology stack. We will also be discussing limitations of the platform while covering various applicable scenarios.

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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

752 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