Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Want to remove all lines but not latest 50 lines from a file Post 302868151 by alister on Saturday 26th of October 2013 07:59:24 AM
Old 10-26-2013
Quote:
Originally Posted by targzeta
Bash:
Code:
n=50000; start=$(( $(wc -l file | cut -d' ' -f1) - $n + 1 )); sed -ni ${start},\$p file

Emanuele
That won't work. The file system is full and the OP wants to edit in place, without using a temporary file.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remove lines from file

file: 1 xxxxxxx 2 xxx xxx 5 xxx xxx ... 180 xxxxxx 200 xxx how to remove any lines with the first number range 1-180 (9 Replies)
Discussion started by: bluemoon1
9 Replies

2. Shell Programming and Scripting

To remove the lines in my file

Hi, There seems to some hack attempts in my site. I have attached the index page of my site and I need to remove the below lines from the index page. The below lines are at the center of the file. --> </style> <script>E V A L( unescape(... (5 Replies)
Discussion started by: gsiva
5 Replies

3. UNIX for Dummies Questions & Answers

vi to remove lines in file

All, I have a text file with several entries like below: personname personname.domain.com I know there is a way to use vi to remove only the personname.domain.com line. Can someone help? I believe that it involves /s/g/ something...I just can't remember the exact syntax. Thanks (2 Replies)
Discussion started by: kjbaumann
2 Replies

4. Shell Programming and Scripting

remove lines from file

Hi gurus, i'm trying to remove a number of lines from a large file using the following command: sed '1,5000d' oldfile > newfile Somehow the lines in the old file are not deleted... Am I doing this wrongly? Any suggestions? :confused: Thanks! :) wee (10 Replies)
Discussion started by: lweegp
10 Replies

5. Shell Programming and Scripting

remove : lines from file

A small question I have a test.txt file I have contents as: a:google b:yahoo : c:facebook : d:hotmail How do I remove the line with : my output should be a:google b:yahoo c:facebook d:hotmail (5 Replies)
Discussion started by: aronmelon
5 Replies

6. Shell Programming and Scripting

remove blank lines and merge lines in shell

Hi, I'm not a expert in shell programming, so i've come here to take help from u gurus. I'm trying to tailor a csv file that i got to make it work for the LOAD FROM command. I've a datatable csv of the below format - --in file format xx,xx,xx ,xx , , , , ,,xx, xxxx,, ,, xxx,... (11 Replies)
Discussion started by: dvah
11 Replies

7. Shell Programming and Scripting

Remove lines from file

Hey Gang- I have a list of servers. I want to exclude servers that begin with and end with certain characters. Is there an easy command to do this? Example wvm1234dev wvm1234pro uvm1122dev uvm1122bku uvm1344dev I want to exclude any lines that start with "wvm" OR "uvm" AND end... (7 Replies)
Discussion started by: idiotboy
7 Replies

8. Shell Programming and Scripting

Two files, remove lines from second based on lines in first

I have two files, a keepout.txt and a database.csv. They're unsorted, but could be sorted. keepout: user1 buser3 anuser19 notheruser27 database: user1,2343,"information about",field,blah,34 user2,4231,"mo info",etc,stuff,43 notheruser27,4344,"hiya",thing,more thing,423... (4 Replies)
Discussion started by: esoffron
4 Replies

9. Shell Programming and Scripting

Remove lines that are subsets of other lines in File

Hello everyone, Although it seems easy, I've been stuck with this problem for a moment now and I can't figure out a way to get it done. My problem is the following: I have a file where each line is a sequence of IP addresses, example : 10.0.0.1 10.0.0.2 10.0.0.5 10.0.0.1 10.0.0.2... (5 Replies)
Discussion started by: MisterJellyBean
5 Replies

10. Shell Programming and Scripting

awk to remove lines that do not start with digit and combine line or lines

I have been searching and trying to come up with an awk that will perform the following on a converted text file (original is a pdf). 1. Since the first two lines are (begin with) text they are removed 2. if $1 is a number then all text is merged (combined) into one line until the next... (3 Replies)
Discussion started by: cmccabe
3 Replies
KINO(1) 						      General Commands Manual							   KINO(1)

NAME
kino - non-linear editing of Digital Video data SYNOPSIS
kino [ ( file | playlist ) ... ] DESCRIPTION
kino allows you to import movies from DV camcorders, to edit, and play them. file may be a DV encoded file that will be loaded at startup. Alternatively, you can specify a SMIL playlist of DV files that was previously created with kino. DV is a special kind of video encoding, commonly used in digital camcorders. Differently coded movies, like DivX or mjpeg, need to be con- verted to DV before they can be fed into kino. A video file either holds the raw DV-coded data, or wraps it in a certain container format. Kino currently supports AVI, and QuickTime con- tainers, and distinguishes between the different formats by file extension. Therefore, file names need to end in .dv or .dif for raw files, .avi for AVI, and .mov for QuickTime files, respectively. Anything else is treated as a SMIL playlist. KEYSTROKES
Unlike other editors, kino uses many keyboard commands for fast navigation and editing inside the movie. It acts on frames that are single images from a movie, scenes that are defined as groupings of one or more frames with recording times differing by no more than one second, and movies that are groups of one or more scenes. The following keystrokes can be used for moving and editing. Some of them are also avail- able as buttons in a graphical menu bar. (Also note the deliberate similarities between kino commands and the text editor vi.) The follow- ing is a brief list of the commands. A more complete list is available in the online help. MOVING AROUND space Toggle between play and pause. l, right-arrow Move one frame forward. h, left-arrow Move one frame backward. gg Move to the start of the movie. G Move to the end of the movie. 0, ^ Move to the start of the current scene. $ Move to the end of the current scene. j, return, +, down-arrow Move to the start of the next scene. k, -, up-arrow Move to the start of the previous scene. ctrl-f Move forward five scenes. ctrl-b Move backwards five scenes. w Move forward one second. b Move backwards one second. DELETE OPERATIONS x, dl, d space, del cut the current frame. dd cut the current scene. d$ cut from current frame to end of scene. d^, d0 cut from start of scene to before current frame. dG cut to end of movie. dgg cut from beginning of movie. CLONE OPERATIONS yl, y space copy the current frame. yy, Y copy the current scene. y$ copy from current frame to end of scene. y^, y0 copy from start of scene to current frame. INSERT OPERATIONS p paste after current frame. P paste before current frame. GENERAL COMMANDS :r inserts a SMIL playlist or DV AVI before frame. (Pops up a file dialog.) :w saves the movie as a SMIL playlist. (Pops up a file dialog.) :q quits the program. SEE ALSO
the kino online help, kino2raw(1), dvgrab(1) AUTHORS
kino was written by Arne Schirmacher <arne@schirmacher.de>, Dan Dennedy <dan@dennedy.org>, and Charles Yates <charles.yates@pandora.be>. This manual page was originally written by Daniel Kobras <kobras@debian.org> for the Debian GNU/Linux system (but may be used by others). January 2004 KINO(1)
All times are GMT -4. The time now is 09:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy