DanF
By:
DanF

No directory listing in ssh

September 14, 2014 1.7k views

A little bit about my background. I have managed servers but always with the help of whm and cpanel. I have used ssh for basic operations. So this is the first time I am setting everything up on my own. I am running Centos 7.

  • I have install Apache, MariaDB and PHP
  • I have tested all of them, and they seem to be working. I created a directory and a php info file.
  • I have accessed sftp via terminal

However for some reason I can't get the directory listing in the terminal. I tried ls and dir. Those are the two commands I am aware of... so clearly I am missing something obvious... Can someone point me in the right direction?

1 comment
2 Answers

I created a directory and a php info file.

How did you create the file ? Do you remember the location where you created the file ?

I can't get the directory listing in the terminal.

Now that you are logged in to the terminal, the current working directory defaults to the home directory for the user.

If you have created the file at say "/home/username/www", you can use either of the options below

ls /home/username/www

or
Navigate to the directory and issue the ls command

cd /home/username/www
ls

Hope it helps

Thanks. I figured it out. I was landing in the root directory, and of course the only files I had there were hidden so nothing would show. On my other server I was used to just do a "cd" to go back to home, but on this one I need to add the "/". As I said... I am new to this...

Have another answer? Share your knowledge.