Is it possible to get tab completion with sftp?
Sometimes I need to quickly copy a file from my remote server to my local machine. Here's my current workflow:
I SSH into my remote server, find the file and copy its full path.
I open new terminal tab and type:
sftp user@hostname:/path/to/file (where /path/to/file is the path I previously copied)
It's not such a pain but it would be really nice if I could skip step 1 and find the path to the file using tab completion directly when typing the sftp command.
To illustrate, I could start typing sftp user@hostname:/ press TAB and get a listing of folders in /. I could then go on typing ho press TAB and it would auto-complete to home, etc. etc.
I'm not sure if such a feature exists and otherwise, is it theoretically possible to write a custom tab completion script as described? Any pointers on where to start?
Sometimes I need to quickly copy a file from my remote server to my local machine. Here's my current workflow:
I SSH into my remote server, find the file and copy its full path.
I open new terminal tab and type:
sftp user@hostname:/path/to/file (where /path/to/file is the path I previously copied)
It's not such a pain but it would be really nice if I could skip step 1 and find the path to the file using tab completion directly when typing the sftp command.
To illustrate, I could start typing sftp user@hostname:/ press TAB and get a listing of folders in /. I could then go on typing ho press TAB and it would auto-complete to home, etc. etc.
I'm not sure if such a feature exists and otherwise, is it theoretically possible to write a custom tab completion script as described? Any pointers on where to start?
No comments:
Post a Comment