I hope someone can explain if this is the right behaviour. I regularly use scp to copy files between hosts like this:
However, today, I made a mistake and typed this instead:
This started copying user@remotehosts $HOME to . on the local host I was on.
So I have now tried
which also copies $HOME to . on the local host. I did not know you could do this. I am under the impression that I must always include a path or at lease /.
What puzzles me further, is how in
it starts writing everything to . instead of /path/to/copy.
Is this the expected behavior? Is it a bug which can be fixed? Could someone please shed some light on this?
I'd consider it a bug, as you've not given any source files -- it should not be finding anything to send. When I try it with my implementation(linux, openssh) I get this error:
If I choose a folder that does not exist on localhost:
Well, is the remote system any different from yours? That's just as important. Expansion on the remote side has been sometimes known to occur strangely on proprietary SSH implementations.
The path after : is optional, with the default being the remote user's
home directory. Consider "scp blah.txt user@host:"
For the case of "scp -prv user@remotehost: /path/to/copy .", it's doing
exactly what you tell it: copying user@remotehost's home directory as
well as /path/to/copy to your local home directory.
Currently I am using this laborious command
lvdisplay | awk '/LV Path/ {p=$3} /LV Name/ {n=$3} /VG Name/ {v=$3} /Block device/ {d=$3; sub(".*:", "/dev/dm-", d); printf "%s\t%s\t%s\n", p, "/dev/mapper/"v"-"n, d}'
Would like to know if there is any shorter method to get this mapping of... (2 Replies)
Where should I put my javascript source code in order to run it "locally" by file not by http?---not sure this "locally" is the appropriate word here.
My test is when my javascript code (test.js) is put in the site default folder as the test.html in /var/www/html both worked as expected with... (2 Replies)
Hi experts,
I have multiple file names ending with .jsp located in $SOME_DIR, $SOME_DIR/f1/,$SOME_DIR/f2/test,$SOME_DIR/f3/fa
and there are equivalent class files in $SOME_DIR/WEB-INF/classes/_pages,$SOME_DIR/WEB-INF/classes/_pages/_f1,... (0 Replies)
I am trying to merge all csv files from source path into one single csv file in target. but getting error message:
hadoop fs -cat /user/hive/warehouse/stage.db/PK_CLOUD_CHARGE/TCH-charge_*.csv > /user/hive/warehouse/stage.db/PK_CLOUD_CHARGE/final/TCH_pb_charge.csv
getting error message:... (0 Replies)
Hi All,
Can you please provide some pointers to move files from Base path to multiple paths in efficient way.Folder Structure is already created.
/Path/AdminUser/User1/1111/Reports/aaa.txt to /Path/User1/1111/Reports/aaa.txt
/Path/AdminUser/User1/2222/Reports/bbb.txt to... (6 Replies)
I'd like to specify a different build and deployment path for files, by default the same path is used for both build and install, I wasn't able to find a way to make these different. With Solaris pkgadd, one can specify different paths in prototype, so I would assume something like that is possible... (0 Replies)
Hi
My requirement is i want to copy files from remote server to the local server and also i need to preserve the timestamp of the remote file.
By using scp -p , it is working fine in the interactive call but it is not preserving he file timestamp when i use it in the non interactive scp call... (1 Reply)
Hi people. I am new to shell scripting, so I need a little help. I want to create a script named that takes an argument as a file, Read the input file and look for occurrences of the current username (say abc.xyz) who is executing the script. On finding an occurrence of the username take that line... (2 Replies)