Fedora :: Run Dd To Delete The Line Which The Cursor Locates?
Sep 21, 2009
when I running vi ,I'd like to run some command(such as dd,p,/word),but I know little of these command,Can I get a manual of that by run some command ,Do you understand what I said,For example,I can run dd to delete the line which the cursor locates,Is there a command (maybe "help" or other)to show the help information about the operation on vim in this condition,not in bash ,not "man vi",
View 6 Replies
ADVERTISEMENT
Mar 3, 2010
I have a log file /var/log/messages. Now all i want is to delete the first line through script without disturbing provisioning the file.
View 1 Replies
View Related
Oct 26, 2010
I just installed Picasa from google and it has corrupted my picture database. The good thing is that it has done it in an organized manner. It appended -1 -2 -3 and so on to the copies file name. They look like (filename.jpg filename-1.jpg filename-2.jpg) the original having no numerical suffix just (filename.jpg)How do i write a command line to remove all of the undesirables without deleting the origionals?
View 7 Replies
View Related
Apr 1, 2009
Was wondering if any perl guru's could help me with a quick log file adjustment. I have a text file that looks like so (tabs and newlines are revealed so you can see what separates the data):
There are maybe 100 lines of text in this file at any given time. I need to delete all duplicate lines only looking at the first bit of text prior to the first tab. It doesn't matter which one gets deleted as long as there are no two lines that begin with that same text at the beginning before the first tab. So in this example, either the fist line "1234" or the last line "1234" would need to be deleted. I already have code in my script that opens the files - I just need the code to read the text into an array and the part that would find matches based on the above criteria, and make the deletions.
If it would be easier, I can even do a system call and use SED (v4.1.5) and/or AWK (3.1.5) instead.
View 7 Replies
View Related
Jun 15, 2010
I m writing a script to delete a line at particular location.
But i m unable to use variable for specifying line number.
For example.
Code:
works fine and deletes 7th line from my file
But
Code:
gives following error.
Code:
View 7 Replies
View Related
Mar 28, 2010
Suppose the cursor position line at bottom or top. What's the vim command to get the cursor position line at the mid of the windows in vim?
View 5 Replies
View Related
Dec 6, 2010
I am using Vi editor for editing and configuring my file.I am facing a little problem when there is long file like 3000 lines. Normally i use
Code:
:set number
in vi editor to visible my line number.The problem is when i have to go in the top of the file like say line number one I use k for it and to move down I use j which is too much time consuming. How can i jump directly my cursor to line number 2333 or line number 2600.
View 4 Replies
View Related
Aug 5, 2010
On Solaris UNIX, pressing Ctrl-g displays the line number for the cursor position.
i.e. line 1 0f n* --0%--
But, on suse Ctrl-g on displays the percentage only, not the hard line number
i.e. n* lines --8%--
Anyway I can make vi display hard line just like Solaris?
View 6 Replies
View Related
Aug 30, 2010
I have Inkscape 0.48 running on a windows xp laptop, but I can't find a way of getting it onto my desktop system running Ubuntu 8.04, which I need to run EMC2.
If I use apt-get to download the latest version, it gets 0.46, which has a cursor/tool bug in it.(The cursor doesn't line up with the tool on screen).
Is it possible for me to successfully transfer 0.48 via a memory stick to the desktop, without jeopardizing the Ubuntu system, or is there some other way ?
View 1 Replies
View Related
Dec 4, 2010
Just in case someone can reply a silly question, I've quite forgot the vi/vim command to bring the cursor to the 1st char in the current line. I do remember that for bringing it to EOL is '$'.
View 14 Replies
View Related
Nov 11, 2010
I was creating a few scripts, I am trying to create a restore script to restore files that have previously been moved to a folder I selected. When moved I stored the original path for these files all in one text file.
I want to know if anyone can tell me how to delete the line from the file after using it restore the file. I have used the grep command to search through the file "pathName" to find where the file was stored but now want to delete that same line.
View 5 Replies
View Related
Apr 1, 2011
if the given pattern exists in the file with the very next line starting and endingwith the same pattern , delete the line that starts and ends with the given pattern.So upon running on this file
hai people<PATTERN> we had
<PATTERN>a lot of fun<PATTERN>
writing scripts
[code]....
View 6 Replies
View Related
Oct 13, 2010
I want to delete lines which contain the word "Fehler" but for some reason my programm isn't working:
Code: BEGIN { FS="|"
OFS="|"
SUBSEP="|"
[code]...
View 6 Replies
View Related
Mar 3, 2010
I have a log file which is continously being accessed. Now I want to delete the first line without disturbing the file.Is it possible? The Issue is the log file is being provisioned with ^@^@^@ characters in the first line occupying huge space.So I need to get rid of that. I dont have time to work with root cause but just a script to reduce this space.
View 3 Replies
View Related
Apr 9, 2011
I would like to delete a single line from a file that contains many lines passing through the same values as the two parameters. Again, I would like to delete a single line and not all those that contain parameters. How can I make bash?
View 14 Replies
View Related
Aug 4, 2010
Delete this with maximum prejudice, mods.
View 1 Replies
View Related
Mar 27, 2011
I have a question about sed programming, actually a one-liner for which I cannot find a solution, right now. I need to delete a line matching a specific pattern only if it is the last line. In practice, I would put together the following:
Code:
#
# This deletes the last line of a file
[code]...
View 5 Replies
View Related
Mar 31, 2011
What's a Unix/Linux one-liner that will let me delete all but the most recent N revisions of each file?
I've got a bunch of files with revision numbers as part of a legacy asset-management system:
bar.r7.js
bar.r8.js
bar.r9.js
bar.r10.js
bar.r11.js
[Code]....
I want to keep the last three of each, so in the above list the command would delete bar.r7.js, bar.r8.js and foo.r1.js.
View 1 Replies
View Related
Apr 14, 2010
Is there a way to remove duplicate files from a specific folder through SSH? I've uploaded a lot of flash games on my server and I can see in the Webmin's file manager that I have many duplicates. Their names are different, of course.
View 2 Replies
View Related
Jul 1, 2010
I want to delete all may mail root in command line and i don't find this... the command mail + "d" work fine but i want use it in a .sh
I explain too : I use fetchmail to have mail from a gmail box, and use RIPMIME to save the attachment in a folder... these work fine, but the i want delete these mails.
View 3 Replies
View Related
Sep 21, 2010
I need a PHP script to delete a line with certain pattern from all filesin a directory. The Directory contain files with extensions .js,.html and.php. Do any body give a working code snippet to Read all files in a directory with above extension and delete that line from the files.
View 1 Replies
View Related
Oct 16, 2010
i have a file containing contents as
1 2 3
2 2 3
11 2 3
now i want to delete the line which first column content is 1. so, if i pass the parametere 1 to function delete_row. is should remove the first row as
2 2 3
11 2 3
and then write the contents in file.
View 2 Replies
View Related
Jan 26, 2010
Quote:Originally Posted by topcatI would like to know how i can write a shell script to delete a line if a particular pattern exists?E.g. I have a text file with multiple lines. Say 1000s. in the following pattern.
username@email.com:149.0.3.4:1
username1@email.com:149.0.3.4:1
username1@email.net:149.0.3.4:1
username1@email.edu:149.0.3.4:1
If the patternusername@email.com exists then the line "username@email.com:149.0.3.4:1 should be deleted from the file.I have a very similar question but I need to delete one line in a file which matches one very precise instance of a string only. Let's assume I have a file composed of thousands of lines and let's call the file chap-secrets. Let's take the following sample entries:
Code:
#USERNAME SERVER PASSWORD IP
pp pptpd blahblah *
[code]....
View 7 Replies
View Related
May 6, 2010
Lets say I have 20 files named FOOXX, where XX is the number of the file, eg 01, 02 etc. At the moment, if I want to delete all files lower than the number 10, this is easy and I just use a wildcard, eg rm FOO0* However, if I want to delete specific files ina range, eg 13-15, this becomes more difficult. rm FPP[13-15] does not work, and asks me if I wish to delete all files. Likewse rm FOO1[3-5] wishes to delete all files that begin with FOO1 So, what is the best way to delete ranges of files like this? I have tried with both bash and zsh, and I don't think they differ so much for such a basic task?
View 2 Replies
View Related
Feb 7, 2011
I have a file "test.txt" with following data
#1
aaa
#2
bbb
#3
aaa
#4
ddd
I wanted it to be displayed as
#1
aaa
#2
bbb
#4
ddd
I used awk "'!x[$0]++' test.txt > file.new"
,but it deleted #1 also.I tried using uniq command but i didn't work.
Can anyone Please let me know is there any way to do this using shell script.
View 2 Replies
View Related
Jan 18, 2010
I have found many information about how to delete/grab a line in a text file including delete line with match a pattern but I did not find info about how to delete a line which match a pattern of a particular column only.
for example mydata.txt:
id type x y z
1 6 0.474611 0.227223 0.583947
[code]....
View 6 Replies
View Related
Jun 24, 2010
I need to find a string in a file ... then delete the line it is on, as well as the next 6 lines. Or, delete the line the string is on and all subsequent lines until the search finds the character "["
example:
filename = test.txt
contents:
[foo]
test>test
test>test
test>test
[Code]....
so, in this example. I'd like to search the file for string 'foo' and delete all lines from that line until [bar] (not deleting the line with [bar])
View 3 Replies
View Related
Apr 12, 2010
I am trying to create a shell script, on taking a input file as parameter, which need to do 3 things
1) create a copy of existing file.
2) add a new line to the copied file.
3) strip off all the absolute paths inside the copied file
The first 2 points are straight forward. but i am finding it difficult to acheive the 3rd point. myself not very good with awk and sed. but gave it a shot in vain. For example, the input script consists of below,
PROGRAM=`/usr/bin/basename $0`
HOST=`/usr/bin/uname -n`
echo Start $PROGRAM `/usr/bin/date` |
/usr/bin/tee -a $LOG
The output of the script should look like,
PROGRAM=`basename $0`
HOST=`uname -n`
echo Start $PROGRAM `date` |
tee -a $LOG
View 14 Replies
View Related
Jul 1, 2010
Im running netbook remix on a eeepc 1005ha. It is my only OS and Im loving it except for one obnoxious quirk. It randomly cuts text and randomly pastes it. If there is something in the clipboard, it will usually paste that, but just as often it will cut random text and paste that. The pastes occur when the cursor focus jumps back to the location of the cursor on the screen. I dont know a better way to phrase that, but thats what it is doing. Say... I put the cursor over the word "pastes" in the paragraph above... even though Im typing in this paragraph, the focus will "jump" to the cursors physical locale (the word "pastes") and then paste whatever is in the clipboard. If the cursor is outside of the textbox, the page will jump to the bottom.
This behavior occurs across programs and in any place text can be entered. I can find no rhyme or reason for it... it just... happens. Sometimes even when Im away from my computer, so its not like Im hitting some key on accident. I have loved everything about this ubuntu distro, but this issue is just toany obnoxious. Writing psych papers on this thing is going to be near impossible if I dont get this fixed before I go back to school.
View 9 Replies
View Related
May 1, 2010
Am running Ubuntu NBR as the sole OS on my Dell Mini 9. Switched over in March to 9.10 NBR. Everything worked fine.Upgraded to 10.04 when it was released. It's awesome EXCEPT for this busy cursor thing.As soon as I log in, all the time my cursor is the spinning wheel of busyness.... It works just as a normal cursor would - my computer also does not seem to be slower due to any operations.If I open an application, the cursor will behave as usual within the window but if I more my cursor to the title bar or switch out of the application, the "busy cursor" resumes.
View 9 Replies
View Related