Skip to content

Instantly share code, notes, and snippets.

@timendum
Created July 27, 2011 10:05
Show Gist options
  • Save timendum/1109055 to your computer and use it in GitHub Desktop.
Save timendum/1109055 to your computer and use it in GitHub Desktop.
List all files in a ftp folder in a text file [ bash ls ]
USER='username'
PASS='password'
HOST='host'
FOLD='folder'
ftp -n $HOST > temp <<END_SCRIPT
quote USER $USER
quote PASS $PASS
cd $FOLD
ls
quit
END_SCRIPT
cat temp | sed 's|.\{56\}||' > $FOLD.txt
rm temp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment