?[0-9]* only expands to names in the current directory that has a digit as their second character.
ls, when getting a directory name, will obviously show the contents of that directory, which means that you will have to tell
ls to not not do that.
You do this with
ls -d -- ?[0-9]*
ls -d ./?[0-9]*
./ will stop
ls from interpreting the first character of the filename as an option if it starts with a dash.
If you are only interested in non-directories (and want to also weed out symbolic links to directories), then there are two immediately obvious ways of doing this.
Use a shell loop, testing each name to see whether it's a directory or not and display the name if it isn't:
for name in ?[0-9]*; do
[ ! -d "$name" ] && printf '%s\n' "$name"
To include files that start with a dot (hidden files), a shell may have a
dotglob shell option that you may set before the loop (
shopt -s dotglob in
find to look for non-directories (and weed out symbolic links to directories) in the current directory:
find -L . -maxdepth 1 ! -type d -name '?[0-9]*'
-L option to
-type d refer to the target of any symbolic link (if the current pathname is a symbolic link).