I was wondering if anyone has encountered any problems with the ls command. I have a directory the has files but when you ls to see the files they don't show up. I know they are there because you can see them with the file manager. Any ideas?
Ok, you can see the files from the file manager but not with ls. So, you know the names of the files that exist in that particular directory. Try 'cat'ing a file !!!
That should if the file really exists in that directory.
I am guessing there might be an alias defined in your /etc/profile or $HOME/.profile to interpret 'ls' differently.
A empty executable file called ls in the directory you are trying to list can cause this if you have the current working directory '.' in your PATH variable. Check this by calling '/usr/bin/ls' in full or 'echo *' which should list all the files. Calling 'whence ls' will tell you where the version of ls you are using is being sourced from.
If the files have backspaces in them i.e. file1^H^H^H^H^H they may not appear on a tty listing. To list files with hidden characters call /usr/bin/ls -b.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.