1
vote
2answers
741 views

insert a string between two patterns

I would like to change file with name like:d1-a2_A1_B1.txtabcd_A90_B2.txtwhere I want to insert _FOO in between first _A[0-9]\+ and _B[0-9] so the file names becomesd1-a2_A1_FOO_B1.txt...
1
vote
2answers
45 views

Having trouble replacing a specific hyphen in directories that follow a specific format in Bash

I have a list of directories using the format:2014-12-03 13-032014-09-03 12-07etc.I need to change them to:2014-12-03 13:032014-09-03 12:07…I’m trying to do this with for d in *\ ??-??; ...
1
vote
1answer
38 views

match files in unordered file with grep

How do I match only file names in an unordered file with grep?I tried grep -Po '[a-zA-Z1-9/_-]{1,}\.php' ( I am trying to match php files),but that doesn't work for e.g http://www.google.com/index....