Questions tagged [strings]
31 questions
2
votes
1 answer
How to replace text string in any type file(for example binary and ...) and multiple files in linux?
I want to replace text string in any type file(for example perl,cgi,text,binary,js and ...) in multiple folder in linux.
How do i do?
Tanks.

M.Rezaei
- 415
- 4
- 9
- 19
2
votes
1 answer
How to find a file that contains the specified string in FreeBSD?
I'm searching for the way to find a file that contains specified string text.
It should be fast as possible but its not that important.
I was reading the manual, and I've build something like that: grep my_string * -r and it works at all, but if…

Cyclone
- 260
- 1
- 6
- 20
2
votes
1 answer
Removing specific characters from a string on ansible
I have the following
- set_fact:
test_result: " {{ htmlres.content | regex_search('http://website([0-9]+)', '\\1') }}"
Using debug, this returns the following " '[01]'"
Wanting only the number, I did some experimenting using the replace()…

Ress
- 45
- 1
- 2
- 8
1
vote
1 answer
How to drop outgoing traffic based on matching string over HTTPS
I am managing a small shared hosting server. Today I received a complaint from my hosting provider that my server is sending out requests on wp-login.php pages of other websites elsewhere. I implemented the firewall rule
/sbin/iptables -I OUTPUT -p…

John
- 15
- 3
1
vote
2 answers
How to report filenames found by strings after being piped through grep?
I've been around *nix long enough to remember having done this in the past, and now those neural pathways are gone... I'm searching /usr/local/lib for files that contain img_convert because I'm getting a link error and want to find the library to…

Alan
- 541
- 1
- 6
- 20
1
vote
0 answers
BASH: No Such File or directory when comparing Strings
I am trying to create a script to compare an inputted string to an empty value. The logic works, but I keep receiving the following error:
./demo.sh: line 13: [[/var: No such file or directory
Here is the code block that I am struggling with:
read…

Reboot
- 11
- 2
0
votes
1 answer
Grepping a single line from iftop
iftop -t -L1 -s1
Output:
iftop -t -L1 -s1 | grep "Total send and receive rate:"
Output:
How can I grep just the "Total send and receive state:" line?

JustAGuy
- 639
- 3
- 23
- 38
0
votes
1 answer
How to whitelist User Agent string?
I'm trying to whitelist a very specific User Agent string in Nginx. The below examples demonstrate how to whitelist general types of browsers (eg mozilla or chrome), but the string I want to whitelist has / and ( which breaks the nginx conf.
How to…

user421936
- 241
- 1
- 3
- 4
0
votes
1 answer
How to remove string and replace with content found in text file using batch script or powershell
How to remove string and replace with content found in text file using batch script.
test.txt
Version: 4.5.0
Import:
//MPackages/Project/config/abc.txt #head
//Packages/Project/config/cde.txt …

tipu
- 3
- 2
0
votes
1 answer
filling up a file with a record with escaped chars
I have this record of a csv:
"0258327469@pippo.it","456281438","16274","782981244047720"," ","