Avoid typing long directory names with scp
Manually copying a file between servers, which should go in the same directory? Here's a shortcut:
Instead of:
scp /long/ass/directory/name/filename.ext \
otherserver:/long/ass/directory/name/filename.ext
Do:
cd /long/ass/directory/name
scp filename.ext otherserver:$PWD
Or add this to .bashrc:
scpsd() { # scp to same directory
scp $1 $2:$PWD
}
...and use like so:
cd /long/ass/directory/name
scpsd filename.ext otherserver
Written by Ohad Lutzky
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Linux
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#