The patterns tag has no wiki summary.
1
vote
1answer
31 views
wget recursive with files without extension
I'm not very good with Linux so I have maybe a basic question. I've search around for the "how to" and I couldn't find anything.
I'm trying to get a site with wget. The problem is that it:
Have ...
5
votes
2answers
36 views
Modifying zsh globbing patterns to use with cp
I'm trying to write a script to copy files recursively from a particular folder except files A.extn, B/*.extn and C/* where B and C are directories and extn is just some generic extension. This is ...
0
votes
3answers
48 views
How to find files ending with ~ and pyc? [duplicate]
I want to find all files (in current and all subdirectory) which end in'~' or 'pyc'. To do so I have tried the following find pattern:
find . -name '*{~,pyc}'
find . -name '{*~,*.pyc}'
but neither ...
10
votes
5answers
357 views
Pattern matching on path names in bash
I want to act on a list of subdirectories in a directory. Consider:
for x in x86-headers/*/C/populate.sh; do echo $x; done
This gives
x86-headers/elf/C/populate.sh
x86-headers/gl/C/populate.sh
...
-5
votes
1answer
69 views
Counting the number of files with in a diectory with a pattern but pattern dosen't know [closed]
To count the files in a directory having some pattern for some files, but we don't know the pattern, then How to count than particular pattern files?
For Example
If a directory has xx_1.txt, ...
5
votes
1answer
2k views
What is the .gitignore pattern equivalent of the regex (Big|Small)(State|City)-[0-9]*\.csv
I have a regex I stuck in my .gitignore similar to:
(Big|Small)(State|City)-[0-9]*\.csv
It didn't work so I tested it against RegexLab.NET.
I then found the gitignore man page which led me to ...
1
vote
2answers
598 views
Pattern matching exception for shell script
So I have the following shell script for batch renaming the episodes of some given TV series:
#!/bin/bash
#script for renaming files of form "*01*.ext" to "Episode 01.ext";
counter=0
for all_files in ...
2
votes
1answer
532 views
How do we specify multiple ignore patterns for `tree` command?
I need to print the directory structure of our production system and I would like to remove some specific directories from the tree?
How do we specify multiple ignore patterns for tree command?
0
votes
1answer
103 views
awk extended pattern matching (embedding pattern matching in actions for already matched strings) [closed]
I want handle strings of the form:
PREFIX_TYPE_N,DATA
So, does the *awk (gawk, mawk, nawk) support including pattern matching in the action for already matched string? Something like this (of ...
5
votes
2answers
874 views
Pattern Matching Exclude Duplicate Characters
Is there a regular expression for the following that matches characters in a character set but only once? In other words, once a character is found, remove it from the set.
If grep cannot do this, ...
1
vote
1answer
213 views
Is there some kind of “patterns” when coding bash scripts?
In Java, we have Javadoc and some different styles when programming. In Python, there's pep8.
I'm creating some bash scripts for my own use, and would like to know from you, experienced bash users, ...

