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.extDo:
cd /long/ass/directory/name
scp filename.ext otherserver:$PWDOr 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 otherserverWritten 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#

 
 
 
 
