1

How do I find all the files whose name starts with tty in the /dev directory?

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232

2 Answers2

1

Open a console and type this:

ls /dev/tty*

The * expands to any pattern, including the empty string.

Kira
  • 4,807
1

All /dev/tty* files are character special files.

You can use find:

find /dev -type c -name 'tty*'

Or in zsh:

print -l /dev/tty*(%c)
heemayl
  • 56,300