The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
0answers
14 views

How do I write a Makefile target for hundreds of numbered files?

I have some art projects that use blender as part of the toolchain. I would like to be able to write a Makefile target which specifies that several hundred files can be updated with a single command. ...
1
vote
1answer
34 views

Different globbing behavior with same shopts?

I have multiple shells (bash) open on the same machine, and in one of them, globbing seems to have stopped. ls * gives ls: *: No such file or directory, and so on. I figured that I must have set some ...
1
vote
2answers
45 views

How to exclude a file from a command with ZSH?

Given this directory content : one.file two.file three.file in bash, when I enter rm *.file !(two) only one.file and three.file are deleted. How can I do this in ZSH?
1
vote
1answer
96 views

Linux Bash Shell - File globbing specific range?

I have a bunch of files in a folder: spreadsheet700.xls spreadsheet800.xls spreadsheet850.xls spreadsheet1005.xls spreadsheet2400.xls how can I use file globbing to select files that numbers end in ...
0
votes
3answers
396 views

How to delete all hidden .swp files from terminal

How can I delete all .swp files? I tried rm *.swp but I got rm: *.swp: No such file or directory rwxr-xr-x 16 teacher staff 544 Jan 17 13:19 . drwxr-xr-x 19 teacher staff 646 Jan 16 12:48 ...
0
votes
1answer
72 views

zshell globing works for ls, but not scp

Note: This problem is with zshell, it works with bash. I have some images: $ ls *.jpg a.jpg b.jpg But when I try to copy them with scp, it says there are none: $ scp *.jpg host: *.jpg: No such ...
2
votes
1answer
241 views

Exclude directories in ZSH glob

With zsh, you can use **/* as a short alternative to using find. Is there any way to restrict that to regular files, that is an equivalent to the -type f option?
0
votes
1answer
215 views

How do bash scripts expand file globs?

In this code, the excludespec variable is expected to match all it substring, but it appears to evaluate the to the actual files matching it when it is executed, rather than pass its exact ...
3
votes
2answers
146 views

how to handle bash * matching when there are no matches?

The following bash snippet works great when there are actually *.txt files in the directory. for txt in *.txt do echo "loading data from $txt" done ...
3
votes
1answer
427 views

rdiff-backup fails from shell script

I am trying to run a shell (sh) script for backups, using rdiff-backup. The lines of interest are: cmd="${prog} -v5 --print-statistics --include-globbing-filelist ${inclist} \ --exclude ** ${src} ...
1
vote
0answers
74 views

How do I get zsh tab completion to “vi **/foo<TAB>” to match and complete the first file matching “foo*” anywhere under the current directory?

How do I get zsh tab completion to cat **/foo<TAB> to match and complete the first file matching foo* in any subdirectory under the current directory? For example, do this while inside a fresh ...
2
votes
1answer
453 views

Bash filename tab completion

I have noticed sometimes that tab completion is helpfully filtered in bash. I am a java programmer and often use the java and javac commands in the terminal for quick or remote tasks. Say I have the ...
3
votes
2answers
262 views

Cat command output varies unusually in regards to * character

I'm running the following command on a fairly standard Ubuntu 11.04 installation running under vSphere: sudo cat /home/*/.ssh/authorized_keys Basically, I am using puppet for ssh key management and ...
2
votes
1answer
265 views

can I make zsh filename completion work like Vim?

I use setopt menu_complete so that I can hit TAB repeatedly to get different filename completions in zsh. However, I would also like to be able to type: ls ~/*.txt<TAB> and then use TAB to ...
0
votes
1answer
52 views

Is it possible to permutate shell globbing expressions?

When using normal shell globbing, * often matches files in lexicographic order. For certain reason, sometimes I don't want this behavior. Is there a way to scramble matching results so their order is ...
6
votes
1answer
2k views

how do I correctly negate zsh globbing expressions?

I want to list all files but those ending with owp: Hence I tried: ls -l *.(^owp) zsh: unknown sort specifier ls -l *(^owp) zsh: unknown sort specifier ls -l *[^o][^w][^p] # does not work ...
1
vote
1answer
598 views

How do I get zsh's autocomplete to complete wildcards like bash does?

In zsh and in bash, if I type ls c<TAB> it displays every filename starting with c. If instead I type ls c*<TAB>, bash behaves the same way, but zsh replaces the c* with the list of every ...
5
votes
5answers
933 views

How to use _one_ shell globbing expression to list all files (of course hidden files too!)?

Ok, this question targets at Unix/Linux shells! I want a shell globbing- (aka wildchard-) expression that matches all files including hidden files in current directory non-recursively (maxdepth == 1). ...
0
votes
0answers
143 views

How to list files ending with .sh only? [duplicate]

Possible Duplicate: How to use grep to see only Listed Files in a directory I have many files in a folder, for example: Kiran.txt Kiran1.txt Kiran221.txt Kiran144.txt Time.csv Timer.csv ...
0
votes
4answers
3k views

How to list files based on matching only part of their filename?

I have many files in a folder for example Kiran.txt Kiran1.txt Kiran221.txt Kiran144.txt Time.csv Timer.csv Timer2.csv Timer444.csv Timer266.csv Account.sh Account3.sh Account3333.sh Account3333.sh ...
0
votes
2answers
508 views

File matching pattern on command line?

Can someone help me with a relatively complex command-line file matching pattern? I've got files in a directory as follows: 1.png 1_thumb.png 1-1.png 1-1_thumb.png 1-2.png 1-2_thumb.png 2.png ...
4
votes
1answer
2k views

Does a wildcard inside double-quotes glob? [closed]

On a "standard BASH" does a wildcard inside double-quotes glob? For example: $ touch abc $ ls "*abc*" would that, or wouldn't that work on bash? I was told Ubuntu shipped with a bash variant that ...
1
vote
1answer
153 views

Is it possible to use brace expansion and globbing together?

Say I wanted to copy the .ssh/authorized_keys file in each user's /home directory to /tmp (for whatever reason). I figured I could use globbing and brace expansion to do this quickly, but I ran into ...
3
votes
2answers
4k views

“ls” or regex is case insensitive?

In bash, I tried ls [a-z]* and expected to list all the files with filename starts with small case alphabet. But why the files with name starts with big case alphabet are also shown? >ls ...
13
votes
5answers
2k views

How to expand * on Bash command line

I understand that if you type ls * it is actually expanded to ls a b c when the current directly has files a, b and c. I was wondering if there is a way to expand this before I hit enter. Similar to ...
10
votes
2answers
1k views

Does bash's * match files in alphanumeric order?

I want to concatenate a bunch of files together in filename order. Is it safe to assume that this will give me them in alphanumeric order? cat * i.e. the same order that ls gives.
13
votes
6answers
19k views

Will rm -rf * remove all files/folders in the current directory?

Will rm -rf * remove all files/folders in the current directory ? I want to make sure the wildcard * won't move up in upper directories and erase all my filesystem. :D I remember doing chmod 777 .* ...