title: A script to ssh into a remote folder and check all files?
body: <p>I have a public/private key pair set up so I can ssh to a remote server without having to log in. I'm trying to write a shell script that will list all the folders in a particular directory on the remote server. My question is: how do I specify the remote location? Here's what I've got:</p>
  
  <pre><code> #!/bin/bash
  
  for file in myname@example.com:dir/*
  do
  if [ -d "$file" ]
  then
  echo $file;
  fi
  done
  </code></pre>