LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do i create a file with 1000 lines ? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-create-a-file-with-1000-lines-683916/)

hemanthv414 11-16-2008 09:01 PM

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

dxqcanada 11-16-2008 09:05 PM

A thousand lines of what ?

ErV 11-16-2008 09:25 PM

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

But there are many other ways to do that.

chickenjoy 11-16-2008 09:32 PM

# seq 1 1000 > file.txt

mrclisdue 11-16-2008 09:34 PM

Done.

Now what's the next homework question?

hemanthv414 11-16-2008 11:17 PM

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 (Post 3344393)
Done.

Now what's the next homework question?


hemanthv414 11-16-2008 11:20 PM

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 (Post 3344391)
# seq 1 1000 > file.txt


chickenjoy 11-17-2008 12:17 AM

@hemanthv414

haha. nice one. :)

mrclisdue 11-17-2008 06:05 AM

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

trickykid 11-17-2008 08:36 AM

Quote:

Originally Posted by mrclisdue (Post 3344731)
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.

H_TeXMeX_H 11-17-2008 08:57 AM

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 :)

trickykid 11-17-2008 09:08 AM

Quote:

Originally Posted by H_TeXMeX_H (Post 3344907)
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.

H_TeXMeX_H 11-17-2008 01:37 PM

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 ?

mrclisdue 11-17-2008 01:43 PM

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....

trickykid 11-17-2008 02:34 PM

Quote:

Originally Posted by H_TeXMeX_H (Post 3345205)
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.


All times are GMT -5. The time now is 09:17 PM.