User Tools

Site Tools


globbing

If you want to send us your comments, please do so. Thanks
More on comments


Globbing

Sometimes it can be handy to specify more than one file for a command. This can be achieved with globbing See theglob man page on line
Or in a terminal do

man 7 glob

Examples

/home/user contains, beside others

a.b.12.34.hello.txt
e.f.56.78.hello.txt
i.j.90.23.freedom.txt
liberty.txt

Only show files not containing hello and have at least 3 dots in the filename

ls -1 /home/user/*.*.*.*[0-9].[!]h]*.log

This does not work

ls -1 /home/user/*[0-9].[!]h]*.log

Here filename-2.txt filename-3.txt filename-4.txt and filename-1.txt are displayed not filename-10.txt

cat filename-[2,3,4,10].txt

Use

cat filename-[2,3,4].txt cat filename-10.txt

instead

Bash globbing reference


Main subjects on this wiki: Linux, Debian, HTML, Microcontrollers, Privacy

RSS
Disclaimer
Privacy statement
Bugs statement
Cookies
Copyright © : 2014 - 2024 Webevaluation.nl and the authors
Changes reserved.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
globbing.txt · Last modified: 26-06-2021 17:53 by wim