Skip to content

Select lines by condition and count with one line command

I need help with analyze nginx logs. Sample of log: Is it possible to select with count all uniq ip addresses which contain per_page parameter and this parameter equal or greater than 100? So, the output can be in any format: Is it possible to get with one command? Answer This is absolutely basic awk – …

Get words from positions in string – Bash/Linux

I have the following string that I want to extract name and id from and store them in a variable. This is just an example, the list can be longer but they are separated the same way. The id’s in the string is freepbx and cidlookup, the names are NEWUPDATES and noauth. I’d like them to come out lik…

How to disable cache memory in kernel modules

I’am currently trying to develop a Linux driver to use a custom module developed in FPGA. For that, I use a Xilinx Zynq SoC with a Linux distribution that runs on the 2 ARM cores and my VHDL modules are implemented on the FPGA part, but this is not really important to understand my problem. My FPGA modu…

Crontab Entry Causing Unknown Command

The entry Is causing the following error: My script has the shebang at the top: I think the python3 path is correct: As suggested, I looked for a CR but none found: What should I try? Thanks Answer Make sure the end-of-line does not contains Carriage return, but only new line. If there’s carriage return…

Inserting text in a ‘find’ command search

I have a find string that finds all the instances of a particular filename in a path, like so: I need to return the result with ‘FINENAME=’ prepended on each line. Having a hard time figuring the best way. Answer Note that if you have a directory named /opt/logs (and you’re not trying to loo…