FG
💻 Software

How to use wildcards with ls without listing directory contents?

Fresh7 days ago
Mar 15, 202610891 views
Confidence Score0%
0%

Problem

ls typically displays only the files and folders in the present directory. But once you add a wildcard it starts searching in sub-directories. example: How do you limit the scope to only the current directory? Using OS X

Error Output

$ ls
fight_folder    file1       file2

$ ls f*
file1   file2

fight_folder:
file3

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How to use wildcards with ls without listing directory contents?

Low Risk

suppresses listing the contents of directories listed on the command line (via the wildcard). From the documentation: -d Directories are listed as plain files (not searched recursively).

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment