LinuxQuestions.org
Help answer threads with 0 replies.
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
  Search this Thread
Old 11-16-2008, 10:01 PM   #1
hemanthv414
Member
 
Registered: Oct 2008
Posts: 37

Rep: Reputation: 15
How do i create a file with 1000 lines ?


hello,

can any body tell me on "how to create a file with 1000 lines"...

Should i be doing it with "vim" editor, or "cat" or "dd"

Thanks in advance
 
Old 11-16-2008, 10:05 PM   #2
dxqcanada
Member
 
Registered: Sep 2006
Location: Canada
Distribution: Gentoo
Posts: 702

Rep: Reputation: 43
A thousand lines of what ?
 
Old 11-16-2008, 10:25 PM   #3
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
in vim:
type "1000i", then press "enter", then press "escape"

But there are many other ways to do that.

Last edited by ErV; 11-16-2008 at 10:27 PM.
 
Old 11-16-2008, 10:32 PM   #4
chickenjoy
Member
 
Registered: Apr 2007
Distribution: centos,rhel, solaris
Posts: 217

Rep: Reputation: 30
# seq 1 1000 > file.txt
 
Old 11-16-2008, 10:34 PM   #5
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware -current, 14.2
Posts: 1,085

Rep: Reputation: 195Reputation: 195
Done.

Now what's the next homework question?
 
Old 11-17-2008, 12:17 AM   #6
hemanthv414
Member
 
Registered: Oct 2008
Posts: 37

Original Poster
Rep: Reputation: 15
If u cant answer.. why do u want to knwo my home work questions?

If u cant answer.. why do u want to know my next home work questions?

Quote:
Originally Posted by mrclisdue View Post
Done.

Now what's the next homework question?
 
Old 11-17-2008, 12:20 AM   #7
hemanthv414
Member
 
Registered: Oct 2008
Posts: 37

Original Poster
Rep: Reputation: 15
Thank u

Thank u , im new to linux, so i guess it s a v simple question. but yes! i learnt it now...


Quote:
Originally Posted by chickenjoy View Post
# seq 1 1000 > file.txt
 
Old 11-17-2008, 01:17 AM   #8
chickenjoy
Member
 
Registered: Apr 2007
Distribution: centos,rhel, solaris
Posts: 217

Rep: Reputation: 30
@hemanthv414

haha. nice one.
 
Old 11-17-2008, 07:05 AM   #9
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware -current, 14.2
Posts: 1,085

Rep: Reputation: 195Reputation: 195
The real question should be "Why do you want the members to do your homework rather than doing it yourself?"

Rules that YOU agreed to when you registered:

Code:
http://www.linuxquestions.org/linux/rules.html

Last edited by mrclisdue; 11-17-2008 at 07:11 AM.
 
Old 11-17-2008, 09:36 AM   #10
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
Quote:
Originally Posted by mrclisdue View Post
The real question should be "Why do you want the members to do your homework rather than doing it yourself?"

Rules that YOU agreed to when you registered:

Code:
http://www.linuxquestions.org/linux/rules.html
Now now.. next time just ignore the thread and move to the next one. The rules do say don't expect members to help you but that doesn't mean they can't ask them.
 
Old 11-17-2008, 09:57 AM   #11
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
They really shouldn't ask for help with homework, it actually hurts the OP. I know I did this in computer science class. Some guy never did his homework, and every time I got to class, he asks me if he can "take a look at my homework", I said (like I usually say) "sure". So after doing this for a while there came the test, he failed. Why ? Because he didn't do his homework, I did his homework, and I got an A. There you go, that's why you should do your own homework. I mean, sure, I guess if you really want to fail, I'll be glad to help with that too
 
Old 11-17-2008, 10:08 AM   #12
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
Quote:
Originally Posted by H_TeXMeX_H View Post
They really shouldn't ask for help with homework, it actually hurts the OP. I know I did this in computer science class. Some guy never did his homework, and every time I got to class, he asks me if he can "take a look at my homework", I said (like I usually say) "sure". So after doing this for a while there came the test, he failed. Why ? Because he didn't do his homework, I did his homework, and I got an A. There you go, that's why you should do your own homework. I mean, sure, I guess if you really want to fail, I'll be glad to help with that too
Well I couldn't agree more but unless the OP says it's homework in their initial question, then either help or if it smells like homework and you don't want to help, ignore it and move on, it's that easy.

If someone can't do their own work, then let them fail at learning. But there are also times when someone actually does try and doesn't understand something, they then seek out help. So it can go both ways. But sadly, most of the time it's very simple questions asked that would have taken them less time to look up to get an answer rather than start a thread on a site like this.

So basically, if it smells like homework and they didn't say it was, just move on and ignore it. If they blatantly say it's homework, point them in the right direction or give them hints, then tell them they'll benefit by researching first, then come back if they don't understand something to receive more hints, etc. But let's not assume any simple question is homework, that seems like the mentality of some members. Just because it's simple and you know it doesn't always mean someone else knows it and is learning.
 
Old 11-17-2008, 02:37 PM   #13
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Yeah, well, sure give them some hints and places to look, but don't give them the answer. As for homework vs non, usually it's quite obvious, it's not about simplicity, it's about futility. When the hell would anyone need to make a file of exactly 1000 lines other than a homework exercise ?
 
Old 11-17-2008, 02:43 PM   #14
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware -current, 14.2
Posts: 1,085

Rep: Reputation: 195Reputation: 195
I don't have an issue with people asking homework questions.

Actually, since I am a Nigerian prince who's having an issue with some inheritance money, because of this thread I now have 2 more people I can ask for help.

That being said, I DO have an issue with people who ask for help with homework and then get all defensive when they're discovered....
 
Old 11-17-2008, 03:34 PM   #15
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
Quote:
Originally Posted by H_TeXMeX_H View Post
When the hell would anyone need to make a file of exactly 1000 lines other than a homework exercise ?
Although it's obvious on some levels, why should we be the one to judge if it is or not? It's just as easy to just ignore the thread and move on to the next if you think it is homework or perhaps if you're so inclined to answer them, tell them to man seq or whatever command is used to do what they need to do.

I've seen questions that might have come off as homework that were in fact actual questions that someone had to do at a job.
 
  


Reply


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
How to modify a field in few lines in a file and save the new file - in Perl rounak94 Programming 1 10-02-2008 08:43 PM
Delete first and last lines of a file ChainsawPenguin Programming 5 09-28-2007 08:28 AM
Bash script to read file and alter lines depending on create date ChristianHein Linux - General 13 08-04-2007 06:39 AM
Random file lines directed to a new file. In script an error. In command line no err leventis Programming 1 09-28-2006 08:16 AM
How to remove lines from a file doza Linux - General 2 04-27-2005 12:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:54 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration