Filtering Listing Output
$ ls -l filename.format


Notice that we have just provided the filename as a simple text-matching string filter and as expected ls provided us with the information of only that file.

When you specify the name of a specific file as the filter, the ls command only displays information about that file. You may not always know the exact filename you're looking for. The ls command also recognizes and uses standard wild card characters to match patterns within the filter:

A question mark (?) to represent one character
An asterisk (*) to represent any number of characters

The question mark can be used to replace exactly
one character anywhere in the filter string. For example:


$ ls -l se?up.sh


Similarly, the asterisk can be used to match zero or more characters. Here is an example:


$ ls -l *.sh


Quick Tip: You can place the asterisk or the question mark anywhere in your filter.

Using the asterisk and question mark in the filter is called file globing. File globing is the processing of pattern matching using wild cards. The wild cards are officially called "meta-character" wildcards. You can use more meta-character wildcards for file globing than just the asterisk and question mark.

You can also use brackets as shown below:


$ ls -l se[tc]up.sh


In this example, we used the brackets along with
    two potential choices for a single character in that position,
    t or c. The brackets represent a single character
    position and give you multiple options for file globing.
    You can also specify a range of characters,
    such as an alphabetical range [a -t] :
    

$ ls -l se[a-t]up.sh


File globbing is such a broad topic that it deserves its own separate article to explain each metacharacter. When searching for files, file globing is a useful feature. It can also be used with other shell commands besides ls, such as grep, cut, tr, sed, gawk, rm, cp, and so on. You'll learn more about this in our future articles.

Shell/Bash相关代码片段

convert raw to qcow2 qemu-img

add passphrase to ssh key

linux flush write cache

connect to gitlab without password using ssh

alias linux command

install dbt

longhorn in eks error install open iscsi

npm install prod only

permission denied: ./

vite react install

gnome workspace rename

connect to wifi using linux terminal

B188E2B695BD4743

trouble.nvim

sign_and_send_pubkey: signing failed for ed25519

how to kill all the processon gpu in linux

selenium auto install chrome driver

sed replace space with newline

how to reoload bashrc

Git Cheat sheet

reset migrations and db prisma

prisma force restart

shutdown server remote

install hiddify

redo git commit

how to install wine in fedora39

docker alpine

apt packages kept back

git revert last commit after push

crontab restart

crontab start

crontab stop

easily create https localhost

allow trafic to specific port from host ufw rule

update unturned server

Ionic - Sync changes to android/ios platforms

Ionic - Generate www folder

git bash change php version

how to enable gui debian

how to disable gui debian

cassandra download zip

github login ssh

math, math.js, mathjs

how to set alias in debian

how to move changes to another branch git

npm stripe

ffprobe for video resolution

npm not working

shell parameter expansion

shell string manipulation

shell manipulation

download skype deb

fish shell batch process file

lualatex install

git get folder from one repo to another

create virtual hosts in rocky linux

ubuntu docker image

dotnet remove package from cache

brew cdk not found

STEAM LINUX APEX NOT WORKING

unrar password protected rar file

alias pip to pip3

zsh compinit

linux check docker daemon running

git how to uncommit a commit --amend

remove containers with images and volumns

tauri cargo

can you upgrade the ram in msi p65 creator

ubuntu ssh add private keys

ssh-copy-id proxy jump

postgresql shell

powershell allow port 27017 udp tcp

ufw allow from interface

mac compress folder

shell escape

bash scripting cheat sheet

how to install prisma

uploadthing install

docker pull stuck on waiting

golang nodemon