General :: Remove Words / Text In Directory?
Feb 24, 2011
I have a folder with many many files. e.g html, docs, excel sheet, script etc.
Now I want to find {using grep command}a certain word in that folder/directory and delete it in all the files and scripts that have it.
For example, I want to delete the word /testing (with the slash) in all files in a directory.
View 14 Replies
ADVERTISEMENT
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
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
Mar 3, 2011
For example if i have the following "OneThree" and i want to add the word "Two" between "one" and "three". To have "OneTwoThree" How can i do this?
View 2 Replies
View Related
Mar 7, 2010
How could someone remove all double or more spaces from a group of words? Is there a GUI program or CLI method or both? Example: I like to turn this:
[Code]...
View 2 Replies
View Related
Feb 12, 2011
I wish to move a specified line from a text file:
Quote:
ltoremove=5 #remove 5th line
i=1
while read line ; do
[Code]....
how should this actually be done? is there a shorter faster way to do this?
View 7 Replies
View Related
Dec 6, 2010
I am looking for a way to keep a log and make if then statements if a line exitsts in the log. I also am looking for a way to make a simple loop, like goto line number, and I also am wondering how to add/remove bits of text from a text file (plugins line in server.properties)
View 5 Replies
View Related
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
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
Mar 27, 2011
how to remove the text prefixing the dollar sign in mac terminal?
For example,
Peters-MacBook-Pro:~ peter$ ls my_dir
should become
$ ls my_dir
View 2 Replies
View Related
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
May 13, 2011
I have udev rules that creates a directory for each usb-media that is plugged into my debian to automount usb-media. This directory where mount-points (the mount-directories) are created is passed through a rdp-connection with rdesktop. On our terminalserver there's a drive Z that shows all mount-points with content of usb-media.When users remove usb-media, udev unmounts usb-media and tries to delete the directory that was used to mount usb-media.If the users hasn't closed explorer showing any subfolder of usb-media, the unmount-command succeeds but the rmdir-command fails because the ressource is "busy or used".My question: how can I force to delete this mountpoint? (rmdir doesn't have force and rm -rf doesn't work)Edit: I should add, that I can't use third-party software or additional packages because the linux-machine is a thin-client with very low disk-space.
View 1 Replies
View Related
Apr 18, 2011
i have a hacking attack on my server where some one tried to implement shell and scripts,
also in a directory he placed a symbolic link to my root. i tried to remove it with rm directotyname but it gave me :
> rm directotyname
rm: cannot remove directory `directotyname': Is a directory
how can i remove the symbolic link and make sure it will not happen again ?
View 5 Replies
View Related
Jan 10, 2011
I'm sure I've done this before and am having a brain fart.
I have run into this a couple of time this last month:
I have a list of torrent files (blahblahhexblah.torrent) saved in a text file. I would like to read the text file and populate the client directory.
I can echo the file using:
But I cannot remember how to pipe the output into the directory, nor can I find any resources that describe the process.
Interestingly enough, I've had a couple of opportunities to do similar tasks with passwords and privileges and even across the LAN in the last few days. Solving this problem will help me solve the others for next time.
View 2 Replies
View Related
Nov 20, 2010
I am a member of a group which has written a program whose source code is being held in a specific directory (~cs252/Assignments/basicAsst/project) and we want to go through and change the parameters for the function "sequentialInsert." My job is to find all occurances of the function call to "sequentialInsert" and to also list the files from where the code came from. Also, I have to be in the commandsAsst directory when I do this. I have tried grep and find combined together, and I am at a lost.
View 1 Replies
View Related
Feb 21, 2010
ubuntu@ubuntu:/usr/lib/locale$ sudo rm -R nl_NL.utf8 rm: cannot remove directory `nl_NL.utf8': Input/output error I'm having problems deleting a seemingly corrupted directory to allow for a reconfiguration of this locale, but the OS doesn't let me do it. Why?
View 2 Replies
View Related
Jan 17, 2010
I'm trying to tar a collection of files in a directory called 'my_directory' and remove the originals by using the command:
tar -cvf files.tar my_directory --remove-files
However it is only removing the individual files inside the directory and not the directory itself (which is what I specified in the command). What am I missing here?
View 3 Replies
View Related
Nov 17, 2009
How do I remove the noexec from the tmp directory, temporarily?
View 3 Replies
View Related
Sep 14, 2010
I have a WD external disk, NTFS file system. I mounted it on my Red Hat. While on the external disk, I deleted a directory, which was sent to .Trash-root of that disk.I went to .Trash-root and did rm -rf to completely delete that directory, but I got the following error: cannot remove `<directory>': Input/output errorWhen I do ls -la on that directory that I wish to remove, it shows me it has 0 files inside. But not only I can't remove it, I can't do anything else with it (copy, etc). And I have all the rights on that directory, so this isn't the problem.
View 6 Replies
View Related
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
Feb 11, 2010
I'm able to use the following to remove the target directory and recursively all of its subdirectories and contents. find '/target/directory/' -type d -name '*' -print0 | xargs -0 rm -rf
However, I do not want the target directory to be removed. How can I remove just the files in the target, the subdirectories, and their contents?
View 4 Replies
View Related
Dec 2, 2010
how to write a script so that when I use the 'del' command it removes/sends the files / folders to a I specify for example 'dustbin'
View 1 Replies
View Related
Oct 19, 2009
how do i remove it?
View 4 Replies
View Related
Jul 7, 2010
I have two questions:How do I remove files from Directory A if their name appears in Directory B?How do I move foo.jpg and bar.jpg from Directory C to Directory D if and only if foo.png and bar.png appear in Directory D?I suspect there's probably a bash one-liner for this, but...I can't come up with it.
View 5 Replies
View Related
Jul 7, 2011
I want to remove the index.html file alone in the every directory via bash script, for example i have 5 directories in the path /var/www/vhost
anish
kumar
linux
question
friend
each directories have index.html file now i want to replace the index.html file alone from the other directory /var/tmp/vhosbak
anish
kumar
linux
question
friend
How we can do this using script?
View 5 Replies
View Related
Jan 28, 2009
I have a text file called file1.txt containing many lines eg.
line1
line2
line3
line4
line5
line6
Then i have another text file called file2.txt contains
3
5
6
Is there a command to remove the lines in file1.txt based on the keywords in file2.txt? note: It should remove line3,line5,line6 based on 3,5,6
View 10 Replies
View Related
Dec 21, 2010
I need to grep a dictionary file.Only the words that contain 2 or more z's and only 1 b needs to be listed.
View 1 Replies
View Related
Jun 14, 2010
Prior to 10.04 there was a preference for menus which allowed you to remove or position the text in menus. I can't find that option in 10.04 nor can I find this parameter in the Configuration Editor. I wish to only have icons in the menu bars of applications.
View 3 Replies
View Related
Feb 12, 2011
I wish to move a specified line from a text file:
Quote:
ltoremove=5 #remove 5th line
i=1
while read line ; do
[code]....
how should this actually be done? is there a shorter faster way to do this?
View 3 Replies
View Related
Dec 16, 2010
I am trying to parse some information from a webpage and store the output into an array. Basically i have found using HTML::TokeParser to be useful at stripping out all the html tags, i have one problem with the output though there is 2 occurances of the same "item" within the output.
View 1 Replies
View Related