https://github.com/hectorqin/iterm2-scp
Iterm2 scp helper script. Use scp command to conveniently upload file to server and download file from server
https://github.com/hectorqin/iterm2-scp
Last synced: 7 months ago
JSON representation
Iterm2 scp helper script. Use scp command to conveniently upload file to server and download file from server
- Host: GitHub
- URL: https://github.com/hectorqin/iterm2-scp
- Owner: hectorqin
- Created: 2021-06-19T02:28:26.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-14T01:53:05.000Z (over 2 years ago)
- Last Synced: 2025-02-09T07:26:49.154Z (8 months ago)
- Language: Shell
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# iterm2-scp
Iterm2 scp helper script
## Install
1. Enable SSH ControlMaster or enable SSH public key login, to make scp command noninteractive.
2. Place `server helper function` to shell profile on server.
```bash
scp_helper_func(){ local s="";for i in $@; do s="$s '$i'"; done;echo $s; } && fs(){ scp_helper_func scp_send '-w' "'$(pwd)'" $*; } && js(){ scp_helper_func scp_receive '-w' "'$(pwd)'" $*; }
```3. Add iterm2 trigger
- Regular Expression: `'scp_receive' .*`
- Action: `Run Coprocess`
- Parameters: `/path/to/iterm2-scp.sh '\(tab.currentSession. jobPid)' '\(matches[0])'`
- Turn on `Use interpolated strings for parameters`## Download file from server
```bash
js /path/to/serverfile1 /path/to/serverfile2
```## Upload local file to server
```bash
fs
```