Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-30-2014, 01:15 PM   #1
LQ Newbie
Registered: Aug 2014
Posts: 1

Rep: Reputation: Disabled
Shell Script............

what is the command for copying multiple lines from a particular webpage ????
Old 08-30-2014, 01:29 PM   #2
LQ Guru
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
Have you tried looking at the sed command. That should give you some ideas.
Old 08-30-2014, 01:38 PM   #3
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
In addition to sed, grep and awk are good tools to know. It depends on which line(s) you want to copy and whether you know what they are in advance.
Old 08-30-2014, 02:37 PM   #4
Registered: Jul 2012
Location: Aachen, Germany
Distribution: Void, Debian
Posts: 824

Rep: Reputation: 237Reputation: 237Reputation: 237
Originally Posted by Rachit7 View Post
what is the command for copying multiple lines from a particular webpage ????
What step are you stuck with? To actually get the webpage you can use wget to download it to a local directory.
Then you can process the html with other command line tools. If you do not want to deal with the html code but only want to pull plain text lynx is a good solution. It has a command line option which lets you download a webpage and convert it to plain text.
E.g. like so
lynx -nonumbers -dump
The above command will print the content of the page to stdout, you may want to pipe it into another bash command or redirect it to a file on your disk.
If e.g. you wanted to only get the first three lines you could do
lynx -nonumbers -dump | head -n 3
Old 08-30-2014, 03:45 PM   #5
Senior Member
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
Originally Posted by Rachit7 View Post
what is the command for copying multiple lines from a particular webpage ????
cp index.html copy.html
Copies multiple lines (ok, all lines)

I'm certain that is not what you need/want

Come back with actual details, including sample input and desired output and you will get real help


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script for run an shell script on server using ssh bloodstreetboy Linux - Server 5 01-12-2013 03:23 AM
How to pass command line arguments from one shell script to another shell script VijayaRaghavanLakshman Linux - Newbie 5 01-20-2012 09:12 PM
Executing a Shell script with 654 permissions inside another shell script. changusee2k Linux - Newbie 2 06-07-2011 07:58 PM
shell script problem, want to use shell script auto update IP~! singying304 Programming 4 11-29-2005 05:32 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:18 AM.

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