Globbing means matching files by name patterns containing wildcards.

learn more… | top users | synonyms (1)

1
vote
2answers
216 views

Way to write new filename on wildcard input?

I have some experience with Inix terminals from science internships I've been part of, mainly using a few utilities like grep, awk, and sed but there is one thing I've been trying to figure out for a ...
1
vote
5answers
793 views

Find files by the length of filename

I want to find all files by length of the file names. For example if I want to find files of length 1, such as a.go, b.go I put: grep '.\{1\}' file But this does not work. What command can I use ...
1
vote
1answer
125 views

The result of echo * and echo .*

Thereotically, the result of command echo * should be "Any file in the current directory". Should it include the dotfile? Similarly, Should the result of ls * include the dotfile?
1
vote
3answers
342 views

Shell script Variable Structure

How can I create a variable with a file name format like : FileName pattern: SnapshotIR__somenumber.csv I tried something like : TODAY=$(date +"%m%d%Y") SNAPSHOT = $(SnapshotIR$TODAY*.csv) I ...
1
vote
3answers
1k views

How can we rename a file with semi-colon as part of the filename?

I tried to rename all file with extension "XLS;1" to "XLS" but it just didn't work. I tried the following in cygwin in windows xp and they don't work: mv *.XLS;1 *.XLS mv *.XLS\;1 *.XLS mv ...
1
vote
3answers
479 views

What does a question mark in a filename matching pattern mean?

What does the question mark in this command mean? find . –type d –name "?d*" –print I tried to to run it without it but didn't notice any change.
1
vote
2answers
112 views

How to get “current glob” in zsh

I want to do something like: $ convert [a,b,c,d,e].png -resize 50% <current_match>_half.png How can I do this? Is there some variable that stores the current match? I couldn't find anything in ...
1
vote
1answer
123 views

Copy files excluding x,y,z causing error in shell script

I'm not well versed in shell scripting but I imagine this to be a painfully easy fix but its eluding me. I need to copy the contents of a directory excluding a number of files. I have a command that ...
1
vote
2answers
331 views

aptitude remove pkg_name* not working like apt-get

I have uninstalled (aptitude purge) the qt-sdk package but there is still a lot of qt4* and libqt* packages on my system. Is there a way to remove all these packages with aptitude remove/purge ...
1
vote
2answers
202 views

Generate a list of files from a file containing a series of globbing patterns

I am looking for a way to build a list of files by parsing a file that contains a sequence of zsh globbing patterns. The final goal is to pass this list of files to hg add in mercurial. For those ...
1
vote
1answer
178 views

How to prevent double escaping?

I'm trying to put a bunch of images together into a pdf. I ran gm convert *.jpg out.pdf and it worked, but the images were not in the right order. I found that ls -v orders them correctly so then I ...
1
vote
3answers
256 views

Reading a directory in shell script

I want to read a numbered directory which is under a path, into a variable in shell script. The paths are something like this: .../releases/R1/... .../releases/R2/... .../releases/R3/... Each time ...
1
vote
2answers
29 views

tar specific files based on a pattern

I got a lot of files with the following format: 2014_04_01_11.txt 2014_04_01_12.txt 2014_04_01_13.txt 2013_03_25_12.txt 2013_04_29_15.txt I would like to tar all theses files into an archive 20?? _ ...
1
vote
2answers
27 views

Is there an equivalent to bash's “nocaseglob” in ksh?

I would like to do what is mentioned in How to match case insensitive patterns with ls? except for ksh. Is it possible to do it without any pain(regex)?
1
vote
1answer
151 views

I quite like mercurial .hgignore-style globbing. Is there a Linux shell that supports it?

I quite like mercurial .hgignore-style pattern globbing. Globs are rooted at the current directory; a glob such as *.c will only match files in the current directory ending with .c. The ...
1
vote
1answer
905 views

How can I zip the contents of current directory minus all hidden files?

How can I zip up the contents (excluding hidden files and folders) of the folder I am currently in? zip -r extension.xpi . -x "*/.*" This is what I have so far, but I am still getting hidden files. ...
1
vote
1answer
185 views

Why does printf ignore the IFS when printing out the result of my script?

This is a follow up to a question posted on SO. I've written a script called except which should print all filenames / directories except the ones given like so. $ ls a b c d $ rm $(except b d) $ ls ...
1
vote
1answer
270 views

restricting pushes to selected Mercurial repositories using `ssh` forced commands and `hg-ssh`

The context of this question is the hg-ssh script. It is helpful but not critical to know something about Mercurial. This script sets up a forced command using public keys so the given public key ...
1
vote
2answers
165 views

Listing all my files modified more than X days ago, in long format

How can I list in long format all files (located in a directory) which belong to me (rights) and were modified more than 7 days ago?
1
vote
1answer
169 views

Bash command that uses wildcard in place of folder to copy folder contents of multiple files into one directory?

I have a directory ~/dir that contains a bunch of random folders like: ~/dir/av 801 and ~/dir/lm 320. I want to copy the contents of every inner folder (ie: av 801) into a different directory. The ...
1
vote
1answer
219 views

imagemagick globbing multiple extensions

I have a folder containing photos coming from different cameras. I use Imagemagick to convert to resized and renamed photos in another folder. Something like this: convert "*.jpg" \ -resize 640 ...
1
vote
1answer
75 views

List all the matched files starting from an index

In zsh, there is the [m,n] glob qualifier which works as follows: [beg[,end]] specifies which of the matched filenames should be included in the returned list. The syntax is the same as for ...
0
votes
4answers
231 views

How to rotate all images in a directory with imagemagic?

I want to rotate all the images in a directory that match a pattern. So far I have: for file in `ls /tmp/p/DSC*.JPG`; do convert $file -rotate 90 file+'_rotated'.JPG done but that gives no ...
0
votes
3answers
217 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 ...
0
votes
2answers
92 views

Supress expansion of * in echo

I am working on a script which dynamically executes some queries on daily basis. These queries are coming from a table in the database. Here is the sample output of the query table: ...
0
votes
2answers
71 views

Regex and patterns on a ksh command line

I'm wondering what's the difference between using * and .* in a regex string. I guess, * stands for "0 to n characters" but I don't see what .* stands for. For example, what is the difference ...
0
votes
4answers
385 views

Bash Globbing Variable Substitution? [duplicate]

Possible Duplicate: Batch renaming files I want to rename files using their existing name as a base for the new one. So if I can ls these files with ls blue*+(.png) I'd want to rename ...
0
votes
2answers
102 views

HTTP Downloader that supports directory index? So that I could use globbing?

Is there an http downloader that supports globbing? i.e. I would like to fetch the latest update of a package, abc-XXX.rpm, but the XXX (version number) is unknown to me. Is it possible to do a ...
0
votes
1answer
42 views

Does wildcarding significantly hurt BIND Performance?

I have enabled RPZ on my BIND 9.9.4 DNS server and I wanted to be able to wildcard some records in my RPZ zone, but I am afraid of the performance hit this might cause. Does anyone out there have some ...
0
votes
0answers
106 views

How to use find command with wildcard when current directory contains a match? [duplicate]

Possible Duplicate: find not recursive when file at top I'm having some confusion with the find command. If I type: find . -name *.xml or find ./ -name *.xml I receive a list of all ...
0
votes
1answer
163 views

Working of the [0-9] [duplicate]

I am learning the shell commands and came across the short tags eg.[0-9],[[:digit:]] etc.. As a proof of concept i tried deleting all the files with the rm command(i know its not a good practise but i ...
-2
votes
1answer
237 views

Why does this script show all files in the directory and not just PDF files?

I wrote the script below to find the number of PDF files in a given directory. However, it instead shows all the files in the directory: #!bin/bash message="." message1="*.pdf" ls -al $message ...