How can I search for a multiline pattern in a file?

I needed to find all the files that contained a specific string pattern. The first solution that comes to mind is using find piped with xargs grep: find . -iname '*.py' | xargs grep -e...

Shell file size in Linux

How can I get the size of a file into a variable? ls -l | grep testing.txt | cut -f6 -d' ' gave the size, but how can I store it in a shell variable?

How to find patterns across multiple lines using grep?

I want to find files that have "abc" AND "efg" in that order, and those two strings are on different lines in that file. Eg: a file with content: blah blah.. blah blah.. blah abc blah blah...

WAS 6.1 java.lang.VerifyError: class loading constraint violated

The environment is WAS 6.1 on Linux, deploying a webapp that uses classes from xercesImpl.jar. Due to company policy restrictions, the app must be deployed with settings: Class Loader Order ...

Regex (grep) for multi-line search needed

Possible Duplicate: How can I search for a multiline pattern in a file ? Use pcregrep I'm running a grep to find any *.sql file that has the word select followed by the word customerName...

Grep. Line of text that does not end with "abcd"?

Hi I'm looking for a regular expression for: line of text that does not end with a certain word, let's say it's "abcd" At first I tried with .*[^abcd]$ That one doesn't work of course. It matches...

Android ACTION_DATE_CHANGED broadcast

I have a Nexus S, and when I change the date manually on the phone, ACTION_DATE_CHANGED is not always broadcasted. If I change the date from Feb 13, 2014 to Feb 14, 2014, I have not gotten an...

How to get exact Sybase DB size in a integer or varchar

I am trying to retrieve the DB size of my sybase DB.But everywhere I got this command to see DB size, "sp_spaceused".But this command is showing all the information along with DB size. Below is...

What should put in the license field of package.json if my code is only for use by the company I work for?

NPM 2.11.3 I'm building a library in Node. This library is only for use by the company I am currently working for. I think this means that the license is "None". But when I npm init it wants me to...

MapView shows blank map inside a fragment (Android MAP API V2)

I'm currently developing an application that integrate with google map. However it didn't run as I expect to be. It shows nothing, just a blank gray screen. I've checked my adb and grep Auth there...

Replace nth line below the searched pattern in a file

I needed to replace 4th line (which contain pattern Y) after a search pattern (say X) in a file. Please note pattern Y is used elsewhere too. So I can't replace it directly. Also note on the 4th...

Bash shell script for finding file size

Consider: var=`ls -l | grep TestFile.txt | awk '{print $5}'` I am able to read file size, but how does it work?

Docker remove <none> TAG images

[email protected]:~# docker images -a REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE <none> <none> 5e2dfc857e73 ...

Add filename before first occurrence of a character in all lines for all files in a given folder

I have a folder full of files with lines which look like this: S149.sh sox preaching.wav _001 trim 889.11 891.23 sox preaching.wav _002 trim 891.45 893.92 sox preaching.wav _003 trim 1599.95...

Print only if field is not empty

I have a text file that I want to pull host and IP info from only if the IP exists in column 4. For example: cat hostlist.txt Server One 255.255.255.255 123.123.123.123 Server Two 255.255.255.255...

Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running?

I have applied every solution available on internet but still I cannot run Docker. I want to use Scrapy Splash on my server. Here is history of commands I ran. docker run -p 8050:8050...

Cannot Start MYSQL Server Mac

I am currently trying to run mysql server on a mac, but the Start MySQL Server from the preferences pane doesn't work, and neither does starting it from the Terminal. I have found a lot of fixes,...

ufw compilation for azure cloud Ubuntu VM

I have a cloud Ubuntu VM which is in some resource group of company's subscription. I do not have access to azure portal. I had opened up the ports whichever relevant in azure portal while...

Boost stack-trace not showing function names and line numbers

I was exploring the boost::stacktrace by trying a simple example to print the call stack of a recursive function. #include "boost/stacktrace.hpp" int factorial(int x){ if (x < 2) { ...

Ansible variables wildcard selection

The only way I've found to select variables by a wildcard is to loop all variables and test match. For example tasks: - debug: var: item loop: "{{ query('dict',...

How to enhance a script for look ups from multiple CSV files

I need to enhance my below script, which takes an input file that contains almost a million unique lines. Against each line, it has different values in 3 lookup files which I intend to add in my...

java.lang.IllegalStateException: No Server ALPNProcessors - WireMock

I am trying to run unit tests (that use Wiremock) on my maven project and the following error is observed. java.lang.IllegalStateException: No Server ALPNProcessors I tried adding the...

certbort commands return ModuleNotFoundError: No module named '_cffi_backend'

I followed a guide to get my python flask app running and I am at the last step where I change http into https with certbot. But when I run my certbot command sudo certbot --nginx -d domainname -d...

AWS logs tail for specific stream name

I'd like to stream Cloudwatch logs from a specific group and log stream. This command does a good job at streaming a group (including all the corresponding streams): aws logs tail /aws/batch/job...

Can't find nix-env or nix-build on MacOS Catalina

I can't find nix-env, nix-build, nix-shell etc. on MacOS Catalina. I installed with: sh <(curl https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume and was able to run them...

Docker Alpine executable binary not found even if in PATH

I have an alpine running container which contains some binaries in usr/local/bin When I ls the content of usr/local/bin I got this output : /usr/local/bin # ls dwg2SVG dwg2dxf dwgadd ...

wxPython not installing via PIP on Apple Silicon M1 Max

Have a project that is written in Python 3.8.x and wxPython. It was developed on an Apple MacBookPro (Intel-based). wxPython installed via PIP inside a virtual environment without problems. Life...

In the ompr package in R, how can I rephrase my objective/constraints/variables so as to avoid the "problem too large" error?

I am trying to learn to fit a linear integer programming optimization model in R using the ompr package that a colleague had previously fit using CPLEX/GAMS (specifically, the one described here:...

Tensorflow setup in R | Error: Failed to load the native TensorFlow runtime

For the last 5 days, I am trying to make Keras/Tensorflow packages work in R. I am using RStudio for installation and have used conda, miniconda, virtualenv but it crashes each time in the end....

Count the number of times a substring appears in a file and place it in a new column

Question: I have 2 files, file 1 is a TSV (BED) file that has 23 base-pair sequences in column 7, for example: 1 779692 779715 Sample_3 + 1 ATGGTGCTTTGTTATGGCAGCTC 1 783462 783485 Sample_4 - 1 ...

Relevant tags