Here's a little bash script I just wrote and thought somebody might find useful. I'm always moving files around using scp and also needing to ssh around to ls them. So why not combine the ssh and the ls into sls -- just like scp, right?
Here are the usage and help text...
usage: sls [ls-option]... user@host[:file]...
sls is a magical combination of ssh and ls. Simply give the sls command some (or no) ls options and one or more remote locations and you'll get a listing for each. The remote spec is the same user@host:file specification you would use with the scp command, and the file part is optional.
And here is the script itself. If you have any fixes or improvements, please let me know.
1 comment:
This is brilliant and I can't believe nobody has commented on it. It was exactly what I was looking for - are we the only two that want this functionality? Thanks much for sharing.
One upgrade that would be appreciated is to support SSH login aliases. By editing ~/.ssh/config on any Unix, including OS/X, you can turn:
scp user@host:file
into
scp alias:file
I think the complex SED line in the script is preventing SSH login aliases from working.
I know enough to install this brilliant script but maybe I should upgrade my skills to modify it to add the feature above.
Thanks again for sharing!
Post a Comment