I am getting question marks and not able to identify the type of file displayed using
ls -l. File types are always displayed as
Can you suggest a solution here?
ls -l shows a question mark (
?) as the first character on the line, it means that the file type is not a normal one recognized by the system. The file is not a regular file, not a directory, not a symbolic link, etc.
This can happen when you mount a non-native filesystem (for example a Solaris filesystem with doors). In this case you may or may not be able to interact with the file by opening it.
Most commonly, this happens when the filesystem has become corrupted. In this case, unmount the filesystem and run
fsck. You may have lost some data.
There's no option for
ls to show the numerical value that encodes the file type. If you want to show the numerical file type, you can use commands such as
strace -e lstat ls -ld the_file strace -e lstat stat the_file perl -e 'printf "0%o\n", (stat($ARGV))' the_file
Knowing this numerical value is typically of little use.