Search for a word before white-space

I’ve got a file with some e-mails: info@example.com info51351@hotmail.com test@hello.com test6261@gmail.com example@example.com example64262@gmail.com And now… I need to find a way to search for specific e-mails address from the list on the left hand-side (before white-space), I already tried to grep/sed it but normally when I’m searching for word “info”, I’m getting both results info@example.com … Read more

grep only returns help text [closed]

Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Server Fault. Closed 9 years ago. Improve this question Well, I am perplexed. I am working with an Ubuntu server and I type in grep ‘bash’ *.sh BUT fgrep ‘bash’ *.sh works … Read more

Plesk Unable to exec utility listmng: Cannot find grep program System error 2: No such file or directory [closed]

Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Server Fault. Closed 7 years ago. Improve this question I have a little problem with my plesk installation at the moment and unfortunately do not have enough knowledge to solve it on … Read more

Linux Bash Scripting using grep sed and cut command to display ip address with port number

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 ;; SERVER: 192.168.1.1#53(192.168.1.1) ;; WHEN: Sat Sep 19 12:20:54 BST 2020 Answer Assuming that each element of the string is separated … Read more

Grep is not working without having read permissions [closed]

Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Server Fault. Closed 6 years ago. Improve this question I am in a folder where I do not have read permission in contents. ls -l List all files sucessfully. I want to … Read more

Listing all packages, but without addional text

In this time I am working of project, what tell you, what software you have installer and what you can install. In this time I have problem with this command: grep -hn Package: /var/lib/apt/lists/* . This command returns me package names, that’s good, but I need hide the other text along it: What i get: … Read more

finding a string among several zipped files (webapps)

We have to find a string, let’s say “foobar” among several webapps. However, some webapps contain zipped files, eg log4j.jar. Therefore, grep -IR “foobar” /pathto/tomcatroot/ won’t work, because of compressed files. unzip -c /pathto/tomcatroot/libdir/log4j.jar |grep foobar can solve the problem, but only for one file Is there a way to achieve this for a whole … Read more

how to replace one url with another using sed inplace replace in multiple files?

As you can see in the script example down there, I’m trying to find and replace (inplace replace) a string which is part of an URL with another string (url part) within ALL files found with that pattern of URL. In other words, all *.txt files which contain ‘https://hostname/‘ must be found and then the … Read more