Skip to content

Tag: grep

top and grep output nothing when run from shell script

I am trying to create shell script that ssh into a remote server and run a script there and print the output in the local server but when I run the script in the local server it most of the time outputs nothing and rarely outputs data : and when I ssh in the local server to the remote server

Using sed/awk to extract multiple strings from each line

I have a file that contains 30million lines(so big file) On each line I have this kind of data: I need to extract both the title value and the rank value so: Little help? 🙂 I have tried my little heart out and nothing, can only extract one piece of data from each line Answer Except in the case there

GREP to search for second column in a text file

I need to GREP second column (path name) from the text file. I have a text file which has a md5checksum filepath size . Such as: the above is the text file, I used grep -Eo ‘[/]’ file.txt but it prints only / , but i want the output like this: Lastly I have to use GREP. Answer If you

Bash issue with floating point numbers in specific format

(Need in bash linux)I have a file with numbers like this Any way possible I can do these 3 steps? 1st I try this then then Final 1 line solution Answer Your “final” solution: should avoid the useless cat, and also move the backslash in the sed script to the correct place (and I added a ^ anchor an…

Loop to filter out lines from apache log files

I have several apache access files that I would like to clean up a bit before I analyze them. I am trying to use grep in the following way: I have several terms that I want to grep, so I am piping every grep action as follow: Until here my rudimentary script works as expected! But I have many apache

How to extract names of compound present in sub files?

I have a list of 15000 compound names (file name: uniq-compounds) which contains names of 15000 folder. the folder have sub files i.e. out.pdbqt which contains names of compound in 3rd Row. (Name = 1-tert-butyl-5-oxo-N-[2-(3-pyridinyl)ethyl]-3-pyrrolidinecarboxamide). I want to extract all those 15000 names b…