I am not very familiar with Linux. I have got root access of a server. When I run the command "ls" then it displays nothing. No error no information nothing. When I run "ls -l" it displays "total 0"
How do I list all files and directories?
I am not very familiar with Linux. I have got root access of a server. When I run the command "ls" then it displays nothing. No error no information nothing. When I run "ls -l" it displays "total 0"
How do I list all files and directories?
The command ls
lists the files and directories. If you have hidden files and folders, you can list them using:
$ ls -a
Adding the option -l
gives a detailed list. You can see man ls
for more options.
It is actually possible that the directory you're in has been deleted from another shell/application/...
This would result in ls -la
displaying total 0
Using cd
, change again to the directory you want to list and retry.
When you login as root, you are most likely in /root (root's home) which is often empty. Try "ls /" or "ls -lah /" to see the contents of the root of the filesystem tree.