Sunday, April 14, 2013

Using Linux Wildcard Figures to determine Linux Sites and Files - A Linux Systemunix Admin Training

Linux Wildcard Figures within the [pattern] A part of a Linux Command

Wildcard figures are utilized inside a Linux [pattern] to result in an order to operate on multiple products plus they represent figures inside a pattern.

An * (asterisk) can be used inside a [pattern] to represent "all figures" within an item (when used by itself) and "other figures" within an item (when combined with other figures, for example letters and amounts).

A ? (question mark) can be used inside a [pattern] to represent just one character. Multiple question marks may be used inside a pattern to represent multiple figures, one character per question mark.

Linux ls Command Good examples of utilizing Wildcard Figures

Run these Linux instructions good examples in your system to come on, practical training experience!

The Linux instructions below likely works will your Linux distribution, but when there's not output in the command, just browse the description and continue with the following command.

List all Linux files starting with "l" within the directory road to /bin:

$ ls -l /bin/l*

List all files which contain the letters "rm" any place in the filename within the sbin directory:

$ ls -l /sbin/*rm*

List all files starting with the letters e, f, g and h within the sbin directory:

$ ls -l /sbin/[e-h]*

Follow the idea of the Linux command good examples above and employ the wildcard designs proven within the table below and run more Linux instructions!

Table of Linux Wildcard Character Good examples

The Linux wildcard figures table below is very helpful!

It shows many different methods for using wildcard figures with Linux instructions.

Listed here are good examples of utilizing Linux wildcard figures within the [pattern] a part of an order.

Within the explanations below, the term "products" can be used to represent "sites and files".

* all products (sites and files) - without or with a suffix
r* products starting with the letter "r"
boot* products starting with "boot"
*mem* products contain "mem" any place in the title
*.png products getting the suffix of ".png" - that finish in ".png" good examples: app1.png and hello.png
?.cfg products beginning with simply one character and ending in ".cfg" good examples: b.cfg and three.cfg
memo?.sxw products starting with "memo", getting just one character after "memo", and getting the suffix of ".sxw"Good examples: memo1.sxw and memoh.sxw - not memo23.sxw
memo??.sxw products starting with "memo", getting a 2 figures (only) after "memo", and getting the suffix of ".sxw"Good examples: memo21.sxw and memok9.sxw - not memos.sxw
[a-z]* products that start with any lower situation letter and finish in almost any other figures
[A-Z]-list.dat products that start with any upper situation letter and finish in "-list.dat"
[a-zA-Z]report.sxc products that start with any lower situation or upper situation letter and finish in "report.sxc"
[c-f]* products that start with the letters "c" through "f"
[Bb]ackup products that start with "B" or "b" and finish in "ackup"
jan[-9] products that start with "jan" and finish inside a number from to 9
letters[3-7] products that start with "letters" and finish inside a number from three to 7

The Linux instructions and ideas covered here affect: Debian, Red-colored Hat, Fedora, Ubuntu, SUSE, Slackware, openSUSE - and all sorts of other Linux distributions.

No comments:

Post a Comment