Skip to main content

Questions tagged [grep]

grep is a command-line tool for searching text patterns in files.

0 votes
2 answers
157 views

I am having an issue in a PHP application, where some processes seem to run for days - still trying to work out how/why but, whilst this happens, the resources on the server get zapped and loads goes ...
bhttoan's user avatar
  • 650
0 votes
1 answer
56 views

What i want to do: i have a virtual-host conf-file (linux-apache server), with several virtual-Host directories in ONE file. This virtual-host conf-File looks like: /etc/apache2/sites-available/...
iksmax's user avatar
  • 1
5 votes
1 answer
22k views

QUESTION Why does my grep command match some lines and then stop with this error grep: /var/log/apache2/modsec_audit.log: binary file matches My grep command: grep '^[' /var/log/apache2/modsec_audit....
user3223819's user avatar
2 votes
3 answers
784 views

I need to filter a row of a csv file by a date. The file is structured as so: [email protected] active 01/24/11 10:04 07/23/23 16:56 ...
dj423's user avatar
  • 23
-1 votes
1 answer
260 views

I have a file that looks like the following: /path/to/a/very/long/path 0 0 0 0 0 0 I need to move the line starting with a number (this can be any value not necessarily 0) to the end of the ...
djc72uk's user avatar
  • 33
1 vote
1 answer
348 views

I have a server for Euro Truck Simulator 2 which is called by the following command: LD_LIBRARY_PATH='$ORIGIN/../../linux64' eurotrucks2_server When the server is running, sometimes I get these lines ...
roughnecks's user avatar
1 vote
1 answer
452 views

This is "myfolder": tree -a 'myfolder' myfolder ├── 20220902 │   ├── filefoo │   └── filebar ├── 20221001 │   ├── filefoo │   └── filebar └── 20221015 ├── filefoo ├── filebar └── ...
acgbox's user avatar
  • 406
1 vote
1 answer
112 views

I have myfolder with this files: ls myfolder filefoo filebar filefoobar For example, the content of filefoo is: total: 379400041 cache_object://localhost/active_requests 379400041 6778 0-...
acgbox's user avatar
  • 406
0 votes
1 answer
1k views

I want to get the latets version number from this website: https://www.mailpiler.org/wiki/download so I do a curl to get the content and then just use a pipe to search for the string using grep curl ...
helpmenicely's user avatar
0 votes
1 answer
2k views

I enter two command in bash: $export g='grep "something"' $echo "something and another thing" | $g But it doesn't work. I want the second command to be evaluated by bash as : ...
rooni's user avatar
  • 149
0 votes
0 answers
122 views

When I run the grep command on Linux on my cPanel-based shared hosting account, I hit an I/O resource limit, it says on the cPanel. I tried to research how to limit resources on a command that I run ...
ServerChecker's user avatar
1 vote
0 answers
1k views

I need to replace a string with the string which is mentioned in a file abcd.txt in all files in a folder. For eg: I want to replace a string 'apple' with whatever the cat output of this file abcd.txt ...
Am3Y's user avatar
  • 77
1 vote
1 answer
66 views

When I use locate on my server and the result is in my rsnapshot backup then I get all those duplicates. I could use grep to filter out all rsnapshot files: locate something_in_backup | grep -v /var/...
rubo77's user avatar
  • 2,537
5 votes
3 answers
930 views

I have a huge MySQL backup file (from mysqldump) with the tables in alphabetical order. My restore failed and I want to pick up where I left off with the next table in the backup file. (I have ...
Christopher Schultz's user avatar
0 votes
1 answer
55 views

I have a daily script that retrieves hardware stats from all of my RHEL servers every night and saves them to a yyyymmdd_daily.log file. I have other scripts that I run against these files to extract ...
PCnetMD's user avatar
1 vote
2 answers
720 views

I'm using grep -ril to be able to see all files that contain a certain string: [user@machine]$ grep -ril "test string" file1.log file2.log file3.log file4.log ... I then would like to zip ...
Ress's user avatar
  • 57
1 vote
0 answers
228 views

I would like to check if the given ip address is already in the config file. But /etc/ can only be accessed by root, and I'm running the a script as admin. It seems I can't just do sudo #!/bin/bash ...
Houman's user avatar
  • 1,735
0 votes
2 answers
2k views

I am using "tail -f /var/log/fail2ban.log -f /var/log/ufw.log | grep -e Ban -e BLOCK -e ALLOW" (without the quotes) and it is working but I want to exclude the results that have the words ...
Greg Azar's user avatar
0 votes
1 answer
240 views

Why does this match .*\/.+\/wp-admin.*404 [03/Sep/2021:18:58:29 +0200] "GET /up/wp-admin/install.php HTTP/1.1" 404 6197 regexr.com But in grep it does not? sudo grep -rh ".*\/.+\/wp-...
lampstackxyz's user avatar
0 votes
1 answer
124 views

I am using tail to monitor a log file and using grep to filer the keyword. tail -F somefile.log | grep "keyword" is working tail -F somefile.log | awk '{print $4}' is working but if to put ...
olo's user avatar
  • 103
1 vote
1 answer
186 views

I am run nginx -V and get like this: nginx version: nginx/1.18.0 built by gcc 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04) built with OpenSSL 1.1.1f 31 Mar 2020 TLS SNI support enabled configure arguments: --...
Petro's user avatar
  • 11
2 votes
1 answer
660 views

I have a text file live below { "data": { "assigned-entity-id": null, "assigned-entity-type": null, "availability-domain": null, "...
Am3Y's user avatar
  • 77
1 vote
2 answers
607 views

I have a text file that looks like this: landlord: John Smith has: house: 0 flat: 5 available: 1 cheap: 0 quality: 1 landlord: Will Hall has: house: 3 flat: 4 available: 1 ...
John Smith's user avatar
1 vote
1 answer
197 views

I would like to export data from zimbra server, but it's export data in every new lines, my command: zmprov -l gaa -v domain.com | grep -e "zimbraForeignPrincipal: " -e "...
Tutek's user avatar
  • 81
0 votes
1 answer
409 views

So, here's the thing. I have a file contains like this: LOG=123 HEY=BRO FOO=BAR LOG=124 I need the value of LOG= and an output like this: 123 124 I already tried using this command: echo "$LOG&...
Azikun's user avatar
  • 3
-2 votes
2 answers
1k views

Can any one please help me I need a output of "192.168.1.1#53" by using these 'grep' 'sed' and 'cut' command mandatory in linux bash scipting in given below text. ;; Query time: 29 msec ;; ...
hemanth singamala's user avatar
0 votes
1 answer
927 views

Using grep to print a keyword in a log to the output file grep -i -n "application" /app/log1.log > L1.log Now this gives results if it finds application in the log. But also results empty ...
chandu rajpurohit's user avatar
0 votes
1 answer
7k views

I'm trying to curl a website and grep it for a specific line in PowerShell. How can I do that? Here's the equivalent of what I'm trying to do, but in BASH user@host:~$ curl -s www.isxkcdshittytoday....
Michael Altfield's user avatar
0 votes
0 answers
44 views

I have some datas with URL's and used network data. I made a custom file with these data's and i stuck last one step. What i have now: sevroland.api.url.com 488 www.logstach.url.com 42725 ...
TDex's user avatar
  • 1
0 votes
1 answer
422 views

I have a change I need to make across multiple different sites and may need to make again in the future, so I'd like to put it in a shell script. Essentially I want to find a specific class block in a ...
TBridges42's user avatar
2 votes
1 answer
3k views

When I login to my CentOS 7 Server I get a couple of errors. Similar command is: 'tty' bash: ls: command not found... Similar command is: 'lz' /usr/libexec/grepconf.sh: line 5: grep: command not found ...
Jonas Heinze's user avatar
0 votes
1 answer
953 views

The server log is too large, I would like to grep the logs which has "/API/login" and "/API/init" from the server log. I'm able to use: tail -f /server.log | grep -i "/API/...
Tech's user avatar
  • 103
0 votes
2 answers
1k views

my server was hacked, and I am now trying to locate all the "strange" files. I am running: find . -type f -name '*' | xargs grep -l "Mini Shell" This command is helping me a lot ...
Pikk's user avatar
  • 359
1 vote
1 answer
2k views

I'm looking to find computers on the network that are using older versions of tls/ssl. So far I've been using nmap's ssl-enum-ciphers and ssl-poodle scripts but the output isn't helpful as it shows ...
rambetherleu's user avatar
1 vote
1 answer
1k views

I am looking for a programmatic way to append to crontab only if the entry does not exist. Also, the exit code must be 0 for both cases where the entry does not exist, or the entry exists. I tried: (...
Justin's user avatar
  • 5,758
0 votes
1 answer
2k views

When I run this command in my terminal: netstat -an | egrep ":80|:443" | sort I got this following output: tcp 0 0 172.104.10.125:48310 172.104.10.125:8081 TIME_WAIT tcp ...
Kalib Zen's user avatar
  • 137
0 votes
1 answer
118 views

I have a little question. I have a list of processes. After this command ps aux | grep postgres I see postgres 1178 0.0 0.2 320064 27060 ? S Apr12 0:05 /usr/lib/postgresql/10/bin/...
Piduna's user avatar
  • 591
0 votes
3 answers
476 views

I am wondering how can I do remove old kernel from Ubuntu operating system. Please refer image screenshot taken. Please advice. Many thanks. list of linux kernel
Nick eric adelee's user avatar
1 vote
1 answer
835 views

I have run a program that writes a lot of log files in a lot of directories. For example, there are hundreds directories, and every one includes thousands of log files. I need to find out the files ...
Leon's user avatar
  • 207
0 votes
1 answer
199 views

I want to check that the ip is present within the ccd folder and push the ip route to the FORWARDING chain in the iptables. Im new to bash scripting and need a little help finishing this script. ...
Kam-ALIEN's user avatar
0 votes
2 answers
979 views

I have a column based .txt file and I want to grep output the Common Name, having a little trouble. V 300223164711Z 01 unknown /C=UK/O=LMG/OU=server/CN=server/name=server/emailAddress=...
Kam-ALIEN's user avatar
0 votes
1 answer
273 views

I have a file that has about 63000 row I need to grep though [root@server]# cat missinglinks.txt 69870 1.pdf.Published 125098 2.png.Published 125022 3.pdf.Published 69867 4.png.Published I have a ...
Andrew Sitterly's user avatar
0 votes
1 answer
310 views

We have multiple servers and i would like to print users list and access level using bash. I tried below command but could not get exact result what i wanted to: awk '/Allow root/{p=5} p > 0 {...
Santosh Garole's user avatar
0 votes
2 answers
111 views

I have this log : Jan 26 01:05:47 server54 kernel: [41s58.6w4335] INPUT:DROP: IN=eth4 OUT= MAC=d3:ss:43:23:23:43 SRC=1.1.1.1 DST=127.0.0.0 LEN=40 TOS=0x00 PREC=0x00 TTL=254 ID=65259 PROTO=TCP SPT=...
malloc's user avatar
  • 103
0 votes
0 answers
79 views

First off; I am sorry if my title is incorrect, but I didn't want to "clutter" it too much. I am creating a bash script which is used to install various servers based on CentOS 6 and CentOS 7 with ...
HudsonHawk's user avatar
2 votes
1 answer
4k views

The question comes from the issue: https://github.com/kubernetes/kubectl/issues/717 Kubectl returns information in a table like this: $ kubectl get replicasets -n kube-system NAMESPACE NAME ...
kivagant's user avatar
  • 123
0 votes
1 answer
1k views

ss -p can give the process name, process id (PID) and the file descriptor associated with the connection. Example: ss -tuanp [...] tcp ESTAB 0 0 x.x.x.x:59594 x.x.x.x:993 users:(("...
wget's user avatar
  • 327
2 votes
1 answer
3k views

I have a named container that may or may not be up and if it is up I want to be able to kill all the containers but that one by name. Basically what I want is: docker kill $(docker ps -aq --filter="...
Itay Weiss's user avatar
0 votes
2 answers
834 views

I am given an array of lines from a text file. They look similar to this, and will always be structured like this: Full Tue Aug 27 10:59:43 2019 1 ...
Kevin's user avatar
  • 133
1 vote
0 answers
87 views

When I use sudo command and pipe it to another command, e.g. sudo dnf search foo | grep bar there is a prompt requiring to enter the password. Following this answer, sudo directly accesses the ...
Konstante's user avatar
  • 111

1
2 3 4 5
7