Leon.37428 wrote: > On 06/15/2016 10:00 AM, emetib wrote: >> jorg wrote- >> >> Better command >> >> scp /home/whatever/file.jpg remote@hostname:/home/user/Pictures/ >> --- >> >> one thing that i've learned is that you should get in the habit when >> cping or mving is to add a ./ when copying, moving into a directory. >> >> >> i.e. >> cp /home/lisi/downloads/whatever.jpg /home/lisi/pictures/./ >> >> all that means is basically this directory. like the ../ meaning the >> directory one up. Once you get into the habit of doing it you'll >> thank yourself especially once you start to get into funky namings of >> dirs that some people do on their computers. >> >> especially once you start spanning miles instead of rooms. >> >> take care >> em >> > > While I am taking note of this, what kind of problems does that > /seemingly/ redundant command do that differs from the above one?
It is "redundant" in the sense that you move all the way into /home/lisi/pictures/, and then say 'this directory here' (with ./). BUT as emetib mentions, being an explicit "this directory here" command will ensurethat the system dumps the file(s) into the directory you expect; or fail out in the event that the destination is not a directory (as it would in this case -- pictures are typically stored in "$HOME/*P*ictures". Remember, capitalization counts). Without the "/./" characters, if you were using something like "scp /path/to/files/*.jpg user@host:/home/user/destination" and "destination" was not already a directory, the system would happily copy every file over the previous one (naming each one 'destination'). HTH -- |_|O|_| Registered Linux user #585947 |_|_|O| Github: https://github.com/dpurgert |O|O|O|