General :: Sed/awk - Remove Section From File

Oct 26, 2010

I have a file like this:

I would like to remove a section between [first] and [second]:

Is almost what I want. I would like the section header to say in place.

Desired output:

View 3 Replies


ADVERTISEMENT

General :: Grab A Random Section In The Middle Of A Huge File?

Apr 23, 2011

I have a huge log file of around 3.5 GB and would like to sample random sections in the middle of say 10 MB for the purpose of debugging what my application is doing.

I could use head or tail commands to get the beginning or end of the file, how can I grab an arbitrary portion from the middle of the file? I guess I could do something like head -n 1.75GB | tail -n 10MB but that seems clumsy and I'd need to determine line numbers for the midpoint of the file to get 1.75GB and 10MB line counts.

View 2 Replies View Related

Ubuntu :: Remove The 'Search And Sort Section' Entirely From The GUI?

Sep 22, 2010

how to remove the 'Search and sort section' entirely from the GUI? I would like to only have the cover view in that whole area with just the library size and the buttons on top. I know you can set the cover view to open in a separate window, but then I have to resize the cover view window to cover that whole area every time I start calibre.

View 1 Replies View Related

Ubuntu :: Safe To Remove Everything That Its Cleaning Section Finds?

Oct 1, 2010

Would like to use Ubuntu Tweak on 10.10 beta. Is it safe to remove everything that its cleaning section finds? Or do I have to look carefully at what it removes? Can I just let it remove everything it finds and not worry that something I have installed will be affected?

View 2 Replies View Related

OpenSUSE Install :: Immutable Section Of HDD + Differencing Section?

Jul 8, 2010

You maybe know that VirtualBox has an "immutable" feature for HDD images. I.e. setup the system, if the stuff is in place, you can set the image to IMMUTABLE to prevent any changes to the image. Differences are written to a separated image. So on the next boot you'll see that all the (unintended) changes are gone and the "old" system is up & running again. I run an old SuSE 10.3 on a write-protected SD-IDE-Adapter. Changing and playing with RPMs is a mess due to around 50 changes I had to do to make that work. Is there any option to mount an SD-card as RO and having all the changes written to e.g. /dev/sda3? To make it clear: I thought about something like a RAID-X system, but could not find any description on how to setup a raidtab.

View 3 Replies View Related

Software :: Split A File By Section?

Aug 27, 2010

How would I go about splitting a file by section? Imagine the file looks like this:

Lots of text 1
Lots of text 2
[HEY, SPLIT HERE]

[code]....

I want to use a command that would split this file, but look for the text "[HEY, SPLIT HERE]" to get the split points.

View 2 Replies View Related

CentOS 5 :: Error: File Contains No Section Headers

Jul 23, 2009

After install CentOS 5.3, when execute yum update in a terminal, with root I had this error:

yum update
Loaded plugins: fastestmirror
Config Error: File contains no section headers.
file: file://///etc/yum.repos.d/CentOS-Media.repo, line: 17
' #file:///media/cdrom/
'
I think I have something wrong with the repositories but I'm not sure.

View 19 Replies View Related

Programming :: Append A Block Of Text Into A Particular Section Of A File?

Mar 16, 2010

So I have file which looks something like this:

cat .opera/operaprefs.ini
Code:
[User Prefs]
Language Files Directory=

[code]...

View 1 Replies View Related

Programming :: Extracting Last Section Of File (Separated By Hashes)

Feb 22, 2011

I have a file which looks something like this:

##########
some
text
text also includes empty lines
##########
some
more
text
##########

Basically all sections are separated by 10 hashes and I need to somehow only print all lines in the last section (the "some more text" part in the example above"). I tried all kind of things with sed and awk but I didn't find any way to identify the last "section".

View 8 Replies View Related

CentOS 5 :: Yum Repolist Config Error 'File Contains No Section Headers'

Mar 7, 2010

i try to run yum update and now i get this error Config Error: File contains no section headers.

[code]....

View 4 Replies View Related

General :: Remove Write-Protected File - Will It Actually Delete The Password File?

Jul 30, 2010

When I ls -l /etc/passwd, -rw-r--r-- 1 root root /etc/passwd When I login as myself, and rm /etc/passwd, it asks: rm: remove write-protected file '/etc/passwd'? If I say yes, will it actually delete the passwd file?

View 1 Replies View Related

General :: Remove The Last From A File?

Mar 10, 2010

I have a file sample.xml . If I do "vi sample.xml" I can see the following

bash$ cat sample.xml
<content/>
bash$
but I don't want the last character so that it becomes following
bash$ cat sample.xml
<content/>bash$

View 12 Replies View Related

General :: Remove File From The Dir With Different Permisison?

May 25, 2011

Dir - test - ls -ld shows ls -ld testdrwxr-xr-x 2 joe stduser 4096 May 25 16:25 testinside test dir :-rw-r--r-- 1 admin stduser 0 May 25 16:25 a.txtHow to remove a.txt with out using sudo ..I just tried sudo -u admin rm test/a.txtrm: cannot remove `test/a.txt': Permission denied

View 3 Replies View Related

General :: How To Remove .tar.gz File / Slackware 13 - 37

Jun 14, 2011

I installed the wrong file and now I would like to remove it. It was one of those .tar.gz files you have to install with ./configure, make, make install.I suspect files were installed all over the place.Is there a utility for removing a .tar.gz file ?

View 2 Replies View Related

General :: Owner Of File Cannot Remove It

Mar 16, 2010

I can't remove a file where I am owner of :

Code:
[jonas@webserver html]$ ls -l | grep file
-rw-rw-r-- 1 jonas jonas 3323 2010-03-15 20:33 file.php
[jonas@webserver html]$ rm file.php
rm: cannot remove 'file.php': Permission denied
The directory that holds this file is html :

Code:
[jonas@webserver mysite]$ ls -l
drwxr-xr-x 2 root root 4096 2010-03-15 18:32 cgi-bin
drwxr-xr-x 9 apache webusers 4096 2010-03-15 20:34 html

View 4 Replies View Related

General :: What Is (1xx 0, 2xx 8, 3xx 0, 4xx 3, 5xx 0) In Logwatch Httpd Section

Nov 27, 2010

In this part of logwatch:

Code:
--------------------- httpd Begin ------------------------
0.12 MB transferred in 11 responses (1xx 0, 2xx 8, 3xx 0, 4xx 3, 5xx 0)

[code]....

View 2 Replies View Related

Ubuntu :: Replace In The Xorg.conf File The Line In The Section "Device"

Nov 10, 2010

I have a Dell precision M50 which has the NVIDIA Quadro4 500 GoGL. When I upgraded from 10.04 to 10.10 the proprietary NVIDIA driver stopped working. At that time I found a simple solution which was to replace in the xorg.conf file the line in the Section "Device":

[Code]...

View 6 Replies View Related

General :: Remove All The Files Which Has A String In A File?

May 8, 2010

I am trying to remove all the files in a directory hierarchy which a certain string inside the file (not the file name, it is the file content).

I can list out all the file name which has a string in the file using 'grep -r -l mystringlooking for'.

But how can I remove all the files returned by the grep ? I am trying this on ubuntu.

View 1 Replies View Related

General :: Allowed To Remove Root File?

Jun 16, 2010

Situation as follows: i do su to root, then i create admin file with

cat > adminfile
then i exit from root issuing exit command
i can see following adminfile options
-rw-r--r-- 1 root root 10 2010-06-16 16:25 adminfile
however, after executing rm adminfile it really gets removed
-rw-r--r-- 1 root root 10 2010-06-16 16:25 adminfile

[Code]...

As i see it - others have only read permision for that file so they shouldnot be able to remove it.. :/

View 2 Replies View Related

General :: Remove Abnormal Character DEL From A File Name?

Jul 22, 2011

I have got certain files which somehow contain abnormal character "Del" "0x7f" or 177 which represents Del. And this is causing SVN to reject these files and abruptly end the process. I need to remove those characters from the file names but am not able to. find or grep do not search the files. This is how the file looks like with ls or find code...

View 3 Replies View Related

General :: Remove A Configured Network File?

Jan 17, 2011

I have to perform a bonding in few of the redhat linux servers. This is the set of files I created in /etc/sysconfig/network-scripts

ifcfg-bond0
DEVICE=bond0
BOOTPROTO=static
IP=XXXX
NETMASK=XXXXX

[Code].....

Those two are showing still configured. What is the procedure to remove them from the configured list. I don't have a x display to do it graphically.

All I want to do is rename them to different file names and remove them from the network service.

View 1 Replies View Related

General :: Remove Services From Nsswitch File?

Oct 11, 2010

According to security manual only DNS, files, or LDAP should be allowed in nsswitch file however it seems like i have many other services configured in nsswitch files.

below are the content from nsswitch file. What services can be removed considering the system stability.

Code:
passwd: files
shadow: files
group: files
hosts: files dns

[Code].....

View 5 Replies View Related

General :: Remove Words In A File Using Sed Or Any Other Command?

Nov 30, 2009

i want to remove words "Max" and "constrained" in a file given below:

Max 0.003745 constrained
Max 0.004549 constrained
Max 0.001689 constrained

[code]....

and further want to replace "Max" by line number so that i can plot the resulting file. i searched in forum, but couldn't do what i wanted to do. e.g. i used

1)grep command

grep -v "Max" inputfile >outputfile

deletes whole line,and hence whole text.

2) sed command

cat inputfile |sed 's/ .{1,12} //g' >outputfile

gives output

0.003745constrained
0.004549constrained
0.001689constrained

[code]....

View 4 Replies View Related

General :: Remove All Lines In A File Containing Sameword?

Aug 6, 2010

When i want to remove particular lines containing a specific word in from entire document at a time,i am using the following command.

awk '$columnno !~/specificword/' inputfile > outputfile

But here, coulmn no is my problem, because iam having this in different columns. So i need a solution for it.

How to write such removal command without mentioning column no. , ie irrespective of column no, it has to remove all lines having that specific word.

View 10 Replies View Related

General :: Section '.bss' Type Changed To PROGBITS

Oct 30, 2010

What does the warning 'section XXX type changed to PROGBITS' mean, and how do I avoid it? I'm compiling some code to run on a sub-processor, and I'm getting this warning during the linking stage.

View 2 Replies View Related

General :: Direct To The Success Stories Section?

Mar 3, 2010

I am having a hard time locating the Success Stories area here.

View 3 Replies View Related

General :: Showing Section In Files That Have Different Names?

Mar 3, 2010

I am running a bash script and I would like a command that will show me what differs from some files with similar names so I can delete them. Or if you can provide some info on how to complete my script. Here is my code:

#!/bin/bash
pwd=SOURCE
#Add extension into the name

[code]...

View 1 Replies View Related

General :: Remove A File On System Using Inode Number?

May 19, 2010

If you create a file on UNIX/linux with special chars, like touch "la*, you can't remove it with rm "la*. You have to use the inode number(you can if you add the before the name, I know, but you'd have to guess as a user that it was used in the file creation).

I checked the manpage for rm, but there's no metion of the inode number. Doing rm inodenumber doesn't work either.

What is the command for this?

View 4 Replies View Related

General :: Remove Background Layer Of Djvu File?

Jan 11, 2011

I've downloaded some files from the Internet Archive. They come in different file formats and most of the time I use pdf. However, sometimes the scans are saves in colour instead of b/w. This makes it difficult/impossible to read on a dedicated ebook reader. In that case I downloaded the djvu files as on the PC you can select which layer (color, bw,fore,back) one would like to see. Selecting the bw gives excellent results. However, the ebook reader does not has this option.

The question is, how can I remove /extract a layer from the djvu file and save only this layer.

So far I've tried the following two approaches:

1) select bw in the djvu viewer on the PC and printed to postscript file. Followed by a ps2pdf conversion. This works, but generates a fairly large pdf file. Sure, I can again upload it to any2djvu but it just seems to much manual work for each file.

2) I tried the shared annotation feature and said (mode bw). This works on the PC as desired but is ignored on the ebook reader as the other layers are still present.

View 1 Replies View Related

General :: Weird Commas In My /etc/password File - Remove Them?

Sep 7, 2011

There are weird commas after the real-name parameter of some lines in my /etc/password file.

kye:x:1000:100:Kye,,,:/home/kye:/bin/bash

What gives? Why are they there? Can I remove them?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved