Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ls command not working

Status
Not open for further replies.

unmlobo

MIS
Apr 11, 2003
64
US
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?

 
Files begining with . are hidden files and will show with ls -a
 
Where are you doing this ls from .. telnet or ftp ?
 
I know about the hidden files. It's the other files that I can't see. And I'm doing this from root on the console. I relly don't know what went wrong?
 
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.

Thanks,
Sekhar.
 
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top