![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Mar 2002
Posts: 7,245
|
![]() Is there a command that will delete the first 50 lines in a file? I know I can display the first 50 lines with "head -50 somefile.txt", but I need to delete the first 50 lines.
![]()
__________________
7 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 | |
Registered User
Industry Role:
Join Date: May 2001
Location: Са́нкт-Петербу́рг
Posts: 10,945
|
Quote:
then control k (fifty times) then control o You are welcome. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Jul 2002
Location: Australia
Posts: 121
|
Pico schmico... use vi and go...
vi file.txt 50dd :wq! done... |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Registered User
Join Date: Oct 2002
Posts: 9
|
One can really tell the old-school hackers from the newbies, as good as they may be, few know much of vi!
__________________
A part of the LoveMatch.com network |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Sep 2002
Location: Los Angeles
Posts: 6,830
|
as root do
rm *.* that should fix it
__________________
I can resist everything except temptation |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Confirmed User
Join Date: Sep 2002
Location: Vancity
Posts: 1,681
|
Quote:
![]() do what the vi guy said. labrets method will work fine, but in some cases pico can do some funky shit to your files... truncating lines and shit. I don't use it anymore. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Confirmed User
Join Date: Jul 2002
Location: In a house now. Under an overpass if I don't start making money.
Posts: 123
|
Quote:
![]()
__________________
"If it floats, flies or fucks... rent it" <a href="http://www.goodpussygonebad.com" target="_blank"> <img border="0" src="http://www.goodpussygonebad.com/images/site/GPGBLogo_sm.jpg" width="73" height="74"> |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
Confirmed User
Industry Role:
Join Date: Mar 2002
Posts: 7,245
|
Quote:
Fuck You
__________________
7 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
Industry Role:
Join Date: Jan 2002
Posts: 7,981
|
faytl's way is good.
But if you don't wanna mess around in vi, here's another way: tail +51 somefile.txt > somefile.txt.tmp; mv somefile.txt.tmp somefile.txt tail +51 = it will print the 51'st line to the last line > somefile.txt.tmp = redirect the output to a temp file mv somefile.txt.tmp somefile.txt = move the temp file over the original file (you can skip that part if it's not necessary) |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Confirmed User
Join Date: Jul 2002
Posts: 1,721
|
Quote:
This would only kill files local to the current directory that contain a "."
__________________
the sound of one hand googlewhacking |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 | |
Guest
Posts: n/a
|
Quote:
rm -f / perhaps ? |
|
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Join Date: Mar 2002
Location: how'd I get here?
Posts: 264
|
rm -rf /
f means don't confirm r means recurisve you have to be root if you really want to fuck shit up. Of course, no one should run this command unless they want to hose the machine. To all the vi'ers out there, amen brother. once you go vi, you don't go back. and the tail -51+ method works just as well. root@yourbox:~#
__________________
[this signature intentionally left blank] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 | |
Confirmed User
Industry Role:
Join Date: Mar 2002
Posts: 7,245
|
Quote:
I learned a few advanced commands from you, you must be lethal with a shell ![]()
__________________
7 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |