Created
July 22, 2014 12:12
-
-
Save s10wen/6cf00ab86b96e5d1fa9c to your computer and use it in GitHub Desktop.
copy `ls -al` from a server to local txt file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ssh into server | |
ssh [email protected] | |
# 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 | |
??? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks to https://github.com/mathiasbynens for this nice solution:
If all you need is
ls -al
output, runssh host 'ls -al /some/path' > foo.txt
on your local machine.