Veja man bash e você pode fazer coisas como:
-a file
True if file exists.
-d file
True if file exists and is a directory.
-e file
True if file exists.
-f file
True if file exists and is a regular file.
-u file
True if file exists and its set-user-id bit is set.
-x file
True if file exists and is executable.
-L file
True if file exists and is a symbolic link.
e muitos, muitos mais.
Você também pode procurar "dentro" do arquivo com o comando file (consulte man file ) para obter mais informações.
Em vez de analisar a saída de ls (que sempre causa confusão), deve-se usar /usr/bin/stat -c "%a %n" filename :
$ stat -c "%a %n" .bashrc
700 .bashrc