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?
ahoffmannConnect With a Mentor Commented:
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 ...
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
The new generation of project management tools

With’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

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>/
All Courses

From novice to tech pro — start learning today.