Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I have the following username#machine connection
user1#machine1 -> user2#machine2
How can I copy files from machine2 to machine1?
You can use rsync
Use it like this:
rsync -avz -e ssh remoteuser#remotehost:/remote/dir /this/dir/
Here is step by step tutorial. You can read about differences between rsync and scp here
You can use scp
Use it like this
scp <source path> <destination path>
Where the remote file is addressed as user_name#host_name:path/to/file
Suppose you want to get a file named a.txt which is in the home directory of user user2 on machine2 say, 192.168.1.10. You can do this on your machine1,
scp user2#192.168.1.10:a.txt .
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
This is failing. (the file.txt is in the same folder)
sudo scp file.txt shahid#11.34.45.23:~/
#gives error Permission denied (publickey).
The following works, however, it asks for the local machine password
sudo scp me#localhost:/home/file.xt shahid#11.34.45.23:~/
If the file.txt doesn't contain any critical data, change its permissions to allow reading by others:
$ sudo chmod 744 file.txt
And then try the scp.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
After running a bad command my computer generates folders that start with "--". When I run ls I get something like:
workspace
--workspace
I don't know how to delete these folders through the command line.
rm -r --workspace does not work. I only have access to this machine through CLI so I can't delete them using the gui.
My OS is Linux 18.04
You need to tell rm to stop parsing and use your arguments verbatim. You do this by passing a final -- argument before the file or folder name.
rm -r -- --workspace
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
While doing scp from host PC(ubuntu-12.04) to target board(IMX6), it is giving following error:
#scp Test.txt root#10.20.119.101:/home/root
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Inappropriate ioctl for device
Test.txt 100% 8599 8.4KB/s 00:00
#
Can you guide to fix this issue.
According to these texts (I googled the error), this happens if the super-user account has its default shell changed to bash.
Never do that. It is bad practice to change the default shell for the root user.
See this thread on the comp.unix.admin USENET forum.
I have used ash instead of bash then the error was not observed.
Existing:
/bin/sh -> /bin/bash
Modified:
/bin/sh -> /bin/ash
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
in linux, we have lots of flags to list files in command ls. we can't do the same inside sftp commannd. For example, in linux, I can list a file's full time by runnling command:
ls --full-time filename
when I sftp to a server, I can't run command: ls --full-time.
The ls help in sftp doesn't list all available flags. So can you please tell me what are ls flags in sftp?
Thank you!
The ls command in sftp is an internal sftp command which is in no way related to the ls command of the remote system's core utilites.
sftp (which has a similar interface as ftp) provides it's internal commands to allow listing of files(among other commands), which does not invoke the ls of the core utilities. So do not expect the same behavior.
For more details on sftp's internal commands please refer to sftp manpage or this page
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
The community reviewed whether to reopen this question 1 year ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I am copying 7.5 GB file to a remote server using scp command. At some point in time file transfer breaks and I have to start all over again.
Is the temporary amount of file being transferred completely lost ? Can I somehow restart the transfer from where it has stopped at previous attempt ? If not, is there some standard Unix command line file transfer command for doing that ?
If you need to resume an scp transfer from local to remote, try with rsync:
rsync --partial --progress --rsh=ssh local_file user#host:remote_file
Short version, as pointed out by #aurelijus-rozenas:
rsync -P -e ssh local_file user#host:remote_file
In general the order of args for rsync is
rsync [options] SRC DEST
This is all you need.
rsync -e ssh file host:/directory/.