LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 08-06-2012, 01:59 AM   #1
figure20012
Member
 
Registered: Apr 2012
Posts: 75

Rep: Reputation: Disabled
sed command


sed 's#.*://##' | sed 's:/.*::' | sed 's:^.*.([^.]*).[^.]*:1:' | uniq -c

Could anyone please tell me what this command does?
 
Old 08-06-2012, 02:19 AM   #2
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,168

Rep: Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775
Well how about you tell us where you are stuck? Remembering that sed allows any character to be used when doing a replace, the default being s///

The rest are regular expressions
 
1 members found this post helpful.
Old 08-06-2012, 03:23 AM   #3
etech3
Senior Member
 
Registered: Jul 2009
Location: Virginia
Distribution: Debian Stable Testing Sid Slackware CentOS
Posts: 1,055
Blog Entries: 2

Rep: Reputation: 44
figure20012

Did you run it?

grail
12 hours in front of me! G'day
 
1 members found this post helpful.
Old 08-06-2012, 05:20 AM   #4
figure20012
Member
 
Registered: Apr 2012
Posts: 75

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by etech3 View Post
figure20012

Did you run it?

grail
12 hours in front of me! G'day
thats why i am asking :P
i dont know the effet of it on my linux box
please could you explain?
 
Old 08-06-2012, 09:32 AM   #5
grail
Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 7,168

Rep: Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775
Well as it stands the affect on your linux box will be nil as there is no input.

And here are 3 search results for "regular expressions"

http://www.zytrax.com/tech/web/regex.htm
http://www.regular-expressions.info/
http://www.regexlib.com/?AspxAutoDetectCookieSupport=1
 
Old 08-06-2012, 09:49 AM   #6
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,403
Blog Entries: 1

Rep: Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951
Quote:
Originally Posted by grail View Post
Well as it stands the affect on your linux box will be nil as there is no input.
On top of that, there's no -i flag in sed so even if there was some input, the results would only get displayed in a terminal window.
 
Old 08-06-2012, 07:09 PM   #7
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5
Posts: 16,076

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
See also http://www.grymoire.com/Unix/Sed.html#uh-0

As per sycamorex & you would also have to feed it some data to work on
 
Old 08-06-2012, 07:25 PM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,801

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
Originally Posted by figure20012 View Post
thats why i am asking :P
i dont know the effet of it on my linux box
please could you explain?
There are several possible answers, but they are all questions:
What is it **supposed** to do?
What happens when you run it?
Where did you get it?
etc.

My point---in case you were wondering---it that we need to understand the context of your question.
 
  


Reply

Tags
sed, sed bash


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] sed gives :sed: -e expression #1, char 1: unknown command: `'' samasat Linux - Newbie 10 06-09-2012 05:31 PM
[SOLVED] sed help to run sed command against multiple different file names bkone Programming 2 04-16-2012 12:27 PM
Sed command - command garbled errror gauavmahesh Linux - Newbie 3 03-30-2012 10:04 PM
Modifying text file with "one command line" SED command... daleo Linux - Newbie 3 01-13-2012 05:32 AM
sed command ancys Programming 2 08-05-2006 10:50 AM


All times are GMT -5. The time now is 02:52 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration