Skip to content

Instantly share code, notes, and snippets.

@s10wen
Created July 22, 2014 12:12
Show Gist options
  • Select an option

  • Save s10wen/6cf00ab86b96e5d1fa9c to your computer and use it in GitHub Desktop.

Select an option

Save s10wen/6cf00ab86b96e5d1fa9c to your computer and use it in GitHub Desktop.
copy `ls -al` from a server to local txt file
#!/bin/bash
# ssh into server
ssh server@wherever.com
# cd to path
cd /where/you/want/
# list everything in a vertical list
ls -al
# copy the `ls -al` output and save to a file locally
???
@s10wen

s10wen commented Jul 22, 2014

Copy link
Copy Markdown
Author

Thanks to https://github.com/mathiasbynens for this nice solution:

If all you need is ls -al output, run ssh host 'ls -al /some/path' > foo.txt on your local machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment