How to enter alt key codes in a Linux BASH shell

I'm using ssh in a rsync script.  I'm trying to transfer files from a folder name which has spaces in the name:

rsync -avz -e "ssh -i local-rsync-key /<mybackupdir> backup@<remoteIP>:/datafiles/folder name with space/*"

SSH is having trouble understanding the spaces.  I want to use an alt-key-combination such as  ALT-0255 on the keypad to enter a space, but I can't quite figure out how to do that in the BASH shell in linux.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

try correct quoting like:
rsync -avz -e "ssh -i local-rsync-key"  /<mybackupdir> "backup@<remoteIP>:/datafiles/folder name with space/*"
then it should work also with spaces
You may use single quotes around the folder name
rsync -avz -e "ssh -i local-rsync-key /<mybackupdir> backup@<remoteIP>:'/datafiles/folder name with space/\*'"

# not sure if you need the \ infronmt of *, it may depend of on your OS and/or shell on the remote system.
You better get rid of spaces in file and directory names ...

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

thomaswrightAuthor Commented:
You got me on the right track. Thanks!
thomaswrightAuthor Commented:
The proper syntax for the solution is

sync -avz -e "ssh -i local-rsync-key /<mybackupdir> backup@<remoteIP>:'/datafiles/folder name with space/'*"

Note: Notice the single quotes surrounding the entire path.
thomaswrightAuthor Commented:
Correction!: I forget a double quote before @backup:

This works:

sync -avz -e "ssh -i local-rsync-key /<mybackupdir> "backup@<remoteIP>:'/datafiles/folder name with space/'*"
thomaswrightAuthor Commented:
I also forgot the destination path, so its:

rsync -avz -e "ssh -i local-rsync-key /<mybackupdir> "backup@<remoteIP>:'/datafiles/folder name with space/'*" /<destinationpath>/
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Storage Software

From novice to tech pro — start learning today.