10 August 2011

BASH: How to determine if a file or directory exists on a remote server

Simple eh?

if ssh -l user server.example.com 'ls folder' > /dev/null; then echo "fexists"; else mkdir folder; fi

No comments:

Post a Comment