Skip to content
Advertisement

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

Extract all unique URL from log with only POST type of the request

I’ve got a log file with the such type of the records: 41.201.181.27 – [2019-04-06 18:22:02] “GET /images/stands/photo_mois.jpg HTTP/1.1” 304 – “http://example.com/popup.php?choix=mois” “Mozilla/4.0” “-” I’ve got the script for getting all records with unique URLs: cut -f4 -d” < logfile | sort -u How i need to change it for getting unique URLs with only POST type of the request?

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 and removed

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 use Grep commands to find specific value in text file

I need to grep a file called daily_fails_count.csv but only find the number of failures. Inside that file is this, on a shorter scale: It’s format is “month,day,hours,failures.” It goes through all months. The last value is the number of failures found at that time. I know here it all says 0 but that’s because no failures were found there,

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 by providing uniq-compound file (it contain folder names e.g ligand_*) out of 50,000 folder. directory and subfiles

How to run a command on file in directory recursively creating a new file in each directory being visited (Bash)?

I have a directory with a few sub-directories. I’d like to create a copy of each results.csv file in the same directory named results_cleaned.csv where certain lines will be removed. Each sub-directory is known to contain only a single file, results.csv. Running this on a single directory works: However, running the same command on a root, produces just a single

Advertisement