Skip to content

Tag: command

How to list filenames containing a specific string

I’ve been searching for commands that would print the list of filenames that contain a specific string, regardless if the string is part of a bigger string. So for instance, say there’s a directory with files “DABC.txt”, “ABC.txt”, “ABC”, and “CDA.txt&#822…

Terminal hangs when executing yum commands

During a patch window, the yum update command stopped running with a Bus Error. Now when I try to execute a yum command my terminal hangs and I need to kill the process. I have tried to kill all the yum commands running that showed with the ps -aef | grep yum, this did not help. I have tried to

Using sed with regex to match varying lines

I’m having some issues used sed to match a regex pattern. An example would be with the following lines: spring-core-4.0.0 should be spring-core-4.1.0 spring-web-4.0.0 should be spring-web-4.1.0 I want the regex to match any characters in between spring and the version number. I’m not sure if I nee…

Sending linux commands in Perl – Grep piped to grep

The basic code: Why wont Perl complete these commands correctly? $fail2ban is already defined to 0, so that’s not the issue. The fail2ban.log does contain a line that should match(when running command from shell it matches): The error i keep getting is: All the commands run fine from bash/shell, seems a…