Skip to main content
added 204 characters in body
Source Link
dr_
  • 32.4k
  • 22
  • 102
  • 147

Use the ? wildcard for file globbing:

ls -d /tmp/????

This will print all files and directories whose filename is 4-char long.

As suggested by @roaima, the -d flag will prevent ls to display the content of subdirectories that match the pattern.

Use the ? wildcard for file globbing:

ls /tmp/????

Use the ? wildcard for file globbing:

ls -d /tmp/????

This will print all files and directories whose filename is 4-char long.

As suggested by @roaima, the -d flag will prevent ls to display the content of subdirectories that match the pattern.

added 5 characters in body
Source Link
cuonglm
  • 158.1k
  • 41
  • 341
  • 419

Use the ? wildcard for file globbing: ls /tmp/????

ls /tmp/????

Use the ? wildcard for file globbing: ls /tmp/????

Use the ? wildcard for file globbing:

ls /tmp/????
Source Link
dr_
  • 32.4k
  • 22
  • 102
  • 147

Use the ? wildcard for file globbing: ls /tmp/????