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


ADVERTISEMENT

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

General :: Get The MAC Address From Windows Xp And Remove It From A File On A Unix Box?

Mar 13, 2011

I am tring to get the MAC address from windows xp and remove it from a file on a unix box. This is what I have so far:

getmac | plink.exe -ssh -pw "my pw" -noagent -m commands.txt root@192.168.1.82
commands.txt
cd /root
tr '-' ':' | tr -d '[:blank:]'

now this is what I get

10:9A:CD:5F:04:8ADeviceTcpip_{5A79FE8D:F227:4B91:9459:2701486C5D94}

All I need is the MAC. Everything after Device* is not needed.The file is /var/db/captiveportal_mac.db. The MAC address are listed like this.

MAC1
MAC2
MAC3
MAC4
MAC5

View 11 Replies View Related

General :: Checking If Table Name Is Repeated In File And If Yes - Remove It ?

Jan 20, 2011

I have an output file that looks like this:

Quote:

Now if you see the first line:

Status for ACCOUNT_MISSING_FRM_RCIS_LINK- mismatch

Status for ACCOUNT_MISSING_FRM_RCIS_LINK is ACCOUNT_MISSING_FRM_RCIS_LINK- does not exist in DB

This should appear just once as :

Quote:

The same goes for last line.

For further information the ACCOUNT_MISSING_FRM_RCIS_LINK is a table name and it row count is taken from a log and then Database checked for the rowcount to see if it is a match,mismatch,or the table does not exist!

I am getting the desird output just that i need to do something to this output file.

View 13 Replies View Related

General :: Commands To Remove Particular Few Lines In History File?

Jun 16, 2010

Is there any commands or scripts to remove only selected line in the history file.

View 1 Replies View Related

General :: Cron To Remove All Files Within Directory Except One File?

Jun 28, 2010

I would like to create a cronjob that will delete all files within a directory 1 hours after it is created to the folderI found this cron find /path/to/file/* -ctime +1 -exec rm {} ; but it's deleted all files.I want to make an exception, all file should be deleted except one file (letsay file a.zip)

View 16 Replies View Related

General :: Remove All The <a Href Links From Text File?

Mar 24, 2010

[Code]....

I am trying to remove <a href links using SED but unable to do it.

The finale result I am looking for is

[Code]....

Is it possible with Linux or should I try with Php?

View 2 Replies View Related

General :: Remove Duplicate Words Within A Particular Text In A File?

Jul 22, 2011

I am basically trying to remove duplicate words in my <title></title> tag after I got hit by Google Panda. I have around 750 .html files and it will be difficult for to me remove one by one. I am looking for a way to remove only from within <title> </title>

Example of a duplicate title I have:

Code:

<title>Pasta, Pasta Recipe and Pasta Guide</title>

I dont want to replace those words anywhere else in the file except for within the <title>

View 14 Replies View Related

General :: Remove Spaces From Many File Names Under Cygwin?

Nov 22, 2010

I'm hoping that someone can help me, I need to remove spaces (not replace with underscores) from several thousand files on a system with cygwin.
Can I do this from the shell using rename or mv somehow?

View 4 Replies View Related

General :: Remove Lone Lines From A Text File?

Jul 6, 2011

anyone has ideas how to remove lone lines from a text file?

If I have a file that is like this:
-----------------------------------
line 1

[code]...

View 14 Replies View Related

General :: Can't Delete File (rm: Cannot Remove `nagios': Permission Denied)?

Jul 11, 2010

Code:
[serv@local subsys]$ rm -rf nagios
rm: cannot remove `nagios': Permission denied

[code]....

View 2 Replies View Related

General :: Nokia N900 - Delete A File Or Folder Via Apt-get Remove

Feb 25, 2011

how to delete a file or folder via apt-get remove but my written any rates and stops also tried rm and the file name again failed some sort of ideas otherwise I'm with Nokia n900

View 10 Replies View Related

General :: Made A File Named * In My Home Directory / Remove It?

Oct 19, 2009

how do i remove it?

View 4 Replies View Related

General :: Using Grep To Remove Line And Write Back To Same File?

Feb 10, 2010

remove a line starting with specific word with grep. Here is what I found

grep -v '^cc$' data.txt

Here I remove all lines with on 'cc' in that line. But I want the result write back to data.txt

I try several ways

grep -v '^cc$' data.txt > output.txt # works but to another file
echo `grep -v '^cc$' data.txt` > data.txt # didn't work, all carets gone, become one line
grep -v '^cc$' data.txt > data.txt # data.txt is empty after running this

How can I save the result of grep to the input file?

View 4 Replies View Related

General :: Can't Remove An Audio File With Symbolic Link To Its Binary Itself / Enable It?

Nov 2, 2010

It appears that a write protected socket was established as a symbolic link between an audio file and the binary of the audio itself.
We are unable to remove the files and the holding folder. Attempted all possible combination of RM that I could think of and then graduated to shred. We are unable to do so code...

View 3 Replies View Related

General :: Remove Lines From A Syslog Text File That Have Duplicate Strings

Mar 17, 2011

Trying to remove lines from a syslog text file that have duplicate strings

Mar 10 06:51:11[http-8080-1] INFO com.MYCOMPANY.webservices.userservice.web.UserServiceController [u:2533274802474744|360] Authorize [platformI$tformIdAndOs=2533274802474744|360, userRegion=America|360]

then a few lines down

Mar 10 06:52:03 [http-8080-1] INFO com.MYCOMPANY.webservices.userservice.web.UserServiceController [u:2533274802474744|360] Authorize [platformI$tformIdAndOs=2533274802474744|360, userRegion=America|360

got the same thing in terms of a u: number but the issue is I need to remove duplicates and just leave one and the file has multiple duplicates of different u: numbers and it's 14,000 lines long. can anyone tell me if I can use awk? sed? or sort for something like this to? removing lines that have a certain string in there that's a duplicate.

View 4 Replies View Related







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