Questions tagged [wildcards]

Wildcard patterns or glob patterns are patterns to select a collection of file names or other strings.

Filter by
Sorted by
Tagged with
-1 votes
0 answers
103 views

Traefik dashboard returns 404 page not found + TLS handshake error: remote error: tls: bad certificate (traefik + bind9 + CloudFlare + Let's Encrypt)

I configured Traefik in docker using the guide: Put Wildcard Certificates and SSL on EVERYTHING - Traefik Tutorial But when trying to access the dashboard - I see an error: 404 Page not found enter ...
Riven's user avatar
  • 1
-2 votes
1 answer
67 views

On ubuntu while using JavaScript, what command should I enter to delete my files having a common name in them? You can also use wildcards to help me

For example, I have four files with the names as "one-beta.txt" , "one-alpha.txt" , "two-beta.txt" , "three-gamma.txt". Now I am supposed to delete my files ...
Mamoona's user avatar
0 votes
1 answer
319 views

Apache2 wildcard rewrite

I have a php app on Apache2 that is supposed to treat subdomains on the code level. My goal is to redirect any wildcard subdomain to the main domain's index.php. I do not use .htaccess. I searched ...
igalsc's user avatar
  • 1
0 votes
1 answer
220 views

Can globbing be used to search file contents?

I basically understand that globbing is used for filename expansion in the shell. I also understand that regular expressions are used for text pattern matching within a file. However, is globbing also ...
Grateful's user avatar
  • 139
5 votes
1 answer
2k views

Why doesn't the wildcard "?" work?

I'm learning to use the terminal on Ubuntu with WSL. Right now I'm practicing wildcards, but the ? wildcard doesn't work for me. As you can see, the * wildcard works but this one doesn't: $ ls file* ...
Daniel Sierra's user avatar
-1 votes
1 answer
267 views

What does this sed command actually do with those wildcards

lineNumber=$(dialog --inputbox "Enter the line number to update that line: " 8 60 --stdout) update=$(dialog --inputbox "Please enter the informations as 'name,surname,phone number,e-...
Halil Can Parlayan's user avatar
0 votes
0 answers
880 views

rsync pattern to include all files of specific patterns and exclude the rest, from all subdirectory tree

I mean to rsync some files of a subdirectory tree at dir1. I am using [dir1]$ rsync --itemize-changes --recursive --update --times --include-from="rsync_include.dat" --exclude="*" -...
sancho.s ReinstateMonicaCellio's user avatar
3 votes
4 answers
4k views

What happens if we do rm -rf ../**? Can we restore the data?

I did something like: $ cd /A/B/ $ rm -rf ./* $ rm -rf ../** Due to network issues my system disconnected from Ubuntu. When I came back there were no files or folders in the /A folder.
xxz's user avatar
  • 39
0 votes
1 answer
508 views

[] wildcard doesn't work

I was watching a training video for learning Linux wildcards and I learnt some of them like {},*,?,[] etc. After that I wanted to make some practice and tried to create 300 directory in a folder which ...
TarikTEM's user avatar
0 votes
1 answer
5k views

grep command using wildcards [0-9]

grep ".0000000" data > output I extract the all numeric data ending with .0000000 in the data text file. When I changed this code using wildcard as follows: grep ".[0-9][0-9][0-9][0-...
deepblue's user avatar
  • 284
0 votes
2 answers
169 views

How can I use the same wildcard in different parts of a command?

Say I have the following command which creates a symbolic link from one file to another giving the link the same name without the extension. sudo ln -s ~/foobar/abc.sh ~/fubar/abc How can I do the ...
WhiskerBiscuit's user avatar
0 votes
2 answers
724 views

How to move several folders using double wildcard?

I am trying to move all the folders that have the digit 1 in between (glove.6B.60d.txt) and (model) mv "./*.txt)(1)(m*" "/home/e1" but I get the error message mv: cannot stat './*....
Kong's user avatar
  • 1,171
0 votes
1 answer
291 views

How do I download the .deb package of Vivaldi browser using wget and wilcards? [duplicate]

How to download the latest .deb of Vivaldi browser using wget with the help of wildcards? Vivaldi can't be downloaded without entering the exact name and number of the latest build. For example, wget ...
msf's user avatar
  • 13
1 vote
0 answers
20 views

find: double wildcard [duplicate]

I do find path/to/folder -name *foo.sh The utility lists the relevant files. However, if I do find path/to/folder -name *foo* I receive an error: find: paths must precede expression: Why? What to ...
Viesturs's user avatar
  • 642
10 votes
2 answers
5k views

Is there a way to disable asterisk * interpolation for certain bash commands?

I'd like to be able to write * to my script, and to get * as-is (i.e., without expansion). Bash will try to replace it with local files matching this pattern, and if this pattern doesn't exist, bash ...
Berry Tsakala's user avatar
0 votes
0 answers
29 views

grep regular expression to remove packages [duplicate]

This is an unexpected result I get $ dpkg -l | grep linux-modules-nvidia-440-5.4.0-* rc linux-modules-nvidia-440-5.4.0-26-generic 5.4.0-26.30+2 amd64 ...
sancho.s ReinstateMonicaCellio's user avatar
0 votes
1 answer
421 views

* regex in terminal [duplicate]

On Ubuntu 20.04, the terminal doesn't seem to recognize the *regex. Example, on 18.04 and other prior releases I could just typed and entered sudo apt install ubuntu-restricted* and it would ...
Sirajus Salekin's user avatar
2 votes
1 answer
144 views

How do you list the folder permissions of only certain directories that follow a common pattern in a particular directory?

For example, in the /etc/ directory there are several files named rc0.d, rc1.d, rc2.d, rc3.d etc lets say you want to list the permissions or the sizes of these directories while ignoring other ...
basod3's user avatar
  • 37
0 votes
1 answer
177 views

How can I run (execute) many files with the same filename wild card using one command?

I am using a desktop Windows program that copies multiple Linux ASCII text job files to an AWS CloudFormation (EC2, Linux), as well as copies data to sub-folders. All of the ASCII text "job files" ...
user avatar
1 vote
2 answers
336 views

Filtering for a set of files that start and end with certain characters

Hi I am new to all of this so any help is appreciated!! I have a list of files that I want my bash script to work on such as BG2_45TS02.assembled.fast BG2_45TS02.riboassembled.fastq BG3_45TS02....
Hannah9777's user avatar
4 votes
2 answers
3k views

find with wildcard path and export the result to a file

I need to find files that match this pattern: find root_folder/*/match_string/*.ext "*" means any levels of folders or files. So it means any file with an extention "ext" under root_folder or its ...
jw_'s user avatar
  • 293
0 votes
2 answers
5k views

Download a list of files with wget using wildcards

I have a list of files like: test.com/image01.png test.com/image02.png test.com/image03.png ... test.com/image50.png and want to download them all. One way is to write all names in a file and then: ...
Mohammad Kholghi's user avatar
1 vote
1 answer
1k views

How to find and replace a string including wildcards in LibreOffice Calc?

I have a Calc spreadsheet which I copied and pasted from Wikipedia. It has a bunch of citation links in the form of "[num]". Something like "some data I want to keep [1] [12]". How do I use Find and ...
Broadsworde's user avatar
  • 3,942
1 vote
1 answer
881 views

How can I grep patterns only inside files with a specific file name?

I spent plenty of time searching for an existing question about my issue but I falied to find any solution for this case in specific. I apologize in advance if there is an existing thread/question ...
vmanechini_jr's user avatar
6 votes
1 answer
2k views

Is there a way to use wild cards, redirection or other shell syntax with systemd units?

I have a systemd file to start a jar file. But I want to execute jar file as *.jar. Is there a way to do this? [Unit] Description=Test Background [Service] ExecStart=/usr/bin/java -jar /var/www/...
Janith's user avatar
  • 369
0 votes
0 answers
1k views

mget `*.*` doesn't work

I want to download all files in a folder with ftp. But mget *.* isn't accepted. Here is the terminal output: ftp> ls 200 PORT command successful 150 Directory listing for /DCIM/Camera/ -rw-rw-rw- ...
frepie's user avatar
  • 554
17 votes
4 answers
13k views

Citrix receiver 13.10 on Ubuntu 18.04.1

I am trying to get Citrix receiver to work on my Ubuntu laptop. I've installed the Citrix receiver, however when I try to open the .ica file that my company provides when I login to my organisation's ...
Reza's user avatar
  • 331
0 votes
1 answer
1k views

installing a wildcard Certificate on a subdomain running on ubuntu

i have tried for a full day in vain to install a wildcard Certificate on owncloud (which is a subdomain and running on obuntu 16.04 with apache2) Any one who can help me here with concrete steps? ...
patn's user avatar
  • 1
1 vote
1 answer
656 views

Rsync Exclude MP4's Using Wild Cards For Paths

I am wanting to exclude rendered videos (.mp4) from my rsync backups. However there are some .mp4's I need included in the backup. The difference is the path where the MP4's to be excluded are ...
Ron Piggott's user avatar
1 vote
2 answers
503 views

wildcards on executables (binaries)

I can use wildcards to select certain types of files by their extensions, e.g. mv *.cc src/ How to select executables that don't have an extension?
Viesturs's user avatar
  • 642
-1 votes
3 answers
106 views

How to store a filename currently *.jpg reading in command rm *.jpg? [closed]

I want to use the filename currently used by *. How to get the name of the file?
DENSETSU's user avatar
0 votes
1 answer
530 views

"globstar" equivalent in dash (Debian Almquist Shell)

I am using /bin/dash on a project, but I have need for **/filename.ext to have recursive behavior (i.e. globstar enabled in bash). Is globstar available in dash? Is there a similar feature or ...
Zachary Fields's user avatar
0 votes
0 answers
383 views

Why is this wildcard not working in bash? [duplicate]

I have an alias set up alias nano="nano -B" so everytime I change a <configFile>, a backup <configFile>~ is generated. Now I have a lot of those backups I don't need anymore so I tried ...
derHugo's user avatar
  • 3,306
4 votes
2 answers
2k views

Asterisk not working with grep

I searched for ki with * as per the example below and it should have returned the first three lines. I am not sure why it returns the last line when there is no ki matching it. $ grep "ki*" ...
Aakanksha Chaturvedi's user avatar
4 votes
1 answer
452 views

How does a command (i.e. grep) know when it is run as part of glob expansion?

As per my understanding, a glob wildcard is interpreted by the shell, which then runs the given command for each matching filename. Suppose I have files: abc1, abc2, and abc3 in my current directory. ...
codecitrus's user avatar
2 votes
1 answer
4k views

Grep exclude wildcards not working

I am using Ubuntu 14.04 LTS. I am playing around with grep and I hit an issue piping grep to ls. All examples are limited to a current directory, non-recursive. If I want to list all files ...
Iliyan Stankov's user avatar
1 vote
1 answer
78 views

couldn't understand output of grep with regular expression while using pipe

As far as I know, while using regex with grep single quotes should be used otherwise the shell interpretet it as glob(wildcard) characters and performs a filename expansion, but in the below example, ...
Pankaj Pandey's user avatar
30 votes
4 answers
8k views

How should I glob for all hidden files?

I want to carry out some action (say chown) on all the hidden files in a directory. I know that this .* is not a good idea because it will also find the current . and parent .. directories (I know ...
Zanna's user avatar
  • 69.4k
12 votes
1 answer
2k views

Is globbing a feature of the shell?

I read many questions and answers like this and this one I know wildcards are expanded by the shell before running a command and they are a feature of the shell. Also wildcards work with those ...
Sinoosh's user avatar
  • 2,001
5 votes
1 answer
633 views

How to show a difference between the usage of '*' , '+' and '?' in grep? [duplicate]

I understand that '*' : The preceding item will be matched zero or more times. '?' : The preceding item is optional and will be matched, at most, once. '+' : The preceding item will be matched one or ...
posixKing's user avatar
  • 1,123
9 votes
2 answers
4k views

What is the wildcard specifying one or two characters?

Is there a simpler way to write: wc -l foo?.txt foo??.txt ? Since in my case I have (at most) two digit numbers, I tried using the range specification wc -l foo[1-99].txt but this ended up displaying ...
Matsmath's user avatar
  • 318
2 votes
1 answer
157 views

Is it possible to use wildcards with Geeqie?

For a long time I have been using Gthumb as my image viewer of choice, since it's fast and allows me to use wildcards. Since the last update though (version 3.4.3) the display of low resolution ...
hoodjiah's user avatar
19 votes
2 answers
8k views

Can anyone explain why sudo ls with a wildcard doesn't work?

$ sudo -iu abc ls -ltr /sites/servers/server_instance/logs/access* ls: cannot access /sites/servers/server_instance/logs/access*: No such file or directory $ sudo -iu abc ls -ltr /sites/servers/...
Faisal's user avatar
  • 301
-5 votes
4 answers
3k views

How do I list files which have a "s" as first and a "l" as last char with a shell-command?

I'm trying to list files that start with "s" and with "l". The command I'm trying is ls -l *sfa*
Dr Drej's user avatar
  • 11
1 vote
2 answers
3k views

Problem with using wildcards when I do CP command in Terminal

I am new and try to learning Terminal Command. Today I faced some problem with cp wildcard command option. I wrote in Terminal this command cp Downloads/[:alnum:] test/ Here, Downloads is the ...
Garten786's user avatar
0 votes
1 answer
44 views

How do I move a whole album to a directory using middle characters?

im familiar with wildcards and ?, but what I want to do is move albums into their appropriate directories using the "(Disc X)" located in the middle of the file. So, I've switched to the directory of ...
user avatar
23 votes
2 answers
19k views

Regular expressions VS Filename globbing

I know that Regular expressions are to be used only with characters and strings, but sometimes I find them in the names of files. My question is: are regexes only used with characters or also with ...
Hamza's user avatar
  • 377
6 votes
1 answer
18k views

How to delete this files with wildcards in ubuntu terminal

Just asking how to delete these files (below is a sample). I tried rm -rf '*.upload'. but they are not deleted. Please help. thanks for sharing! sample -4776d77b-15138be20a5--7fe5564294743529948392....
jonathan's user avatar
1 vote
1 answer
1k views

How to delete all files that contains " (2)" wildcards dont work

I would like to delete all files that contains " (2)" --whitout the quotes-- in the file names. I tried first with ls to test ls *(2)* and list all the files in the folder ls "*(2)*" don't list ...
Leosar's user avatar
  • 113
10 votes
4 answers
23k views

7zip: How to exclude file types?

I want to exclude the following file types: epub pdf html (upper case too) azw3 mobi opf txt I have this so far which doesn't seem to work, i get an error saying "Incorrect Command Line". 7z e "-x!...
olfek's user avatar
  • 1,275