1

I know of the scp command to copy files from my local machine to a remote machine. What is a similar command to view the directories in a remote machine? I mean a

 ls -l

shows the files in my local unix machine. How can I view the directories in a remote unix machine? I tried

ls -l <username>@ip_address

but doesn't work

1 Answer 1

9

Use ssh for remote commands-:

ssh <username>@ip_address <command>

E.g.

ssh  <username>@ip_address ls -l <dir>
1
  • 3
    You could even do ssh username@remotehost then type interactive commands on the remotehost terminal; type exit to quit the remote shell and get back to the local machine. Apr 28, 2013 at 20:02

You must log in to answer this question.