I have a problem when using scp on Linux, it says "not a regular file". I looked at other questions/answers about that, but I can't find out what's wrong... I wrote:
scp aa@aa:/home/pictures/file.fits .
to copy file.fits
from aa@aa
, /home/pictures
to the current directory. I also tried without using /home/
, but it didn't work neither...
Do you understand what's wrong?
A regular file is a file that isn't a directory or more exotic kinds of “special” files such as named pipes, devices, sockets, doors, etc. Symbolic links are not regular files either, but they behave like their target when it an application is accessing the content of the file.
In short, SFTP get not a regular file is an error message which indicates an incomplete command usage. So, either transfer the file recursively or use alternatives like SCP or rsync. Today, we saw how our Support Engineers help customer transfer files remotely.
To copy a directory (and all the files it contains), use scp with the -r option. This tells scp to recursively copy the source directory and its contents. You'll be prompted for your password on the source system ( deathstar.com ). The command won't work unless you enter the correct password.
scp (secure copy) command in Linux system is used to copy file(s) between servers in a secure way. The SCP command or secure copy allows secure transferring of files in between the local host and the remote host or between two remote hosts.
I just tested this and found at least 3 situations in which scp will return not a regular file
:
Case #1 seems most likely. If you meant to transfer an entire directory structure with scp
use the -r
option to indicate recursive copy.
"/home/pictures/file.fits" must name an actual filesystem object on the remote server. If it didn't, scp
would have given a different error message.
I see that FITS is an image format. I suppose "/home/pictures/file.fits" is the name of a directory on the remote server, containing FITS files or something like that.
To copy a directory with scp
, you have to supply the "-r" flag:
scp -r aa@aa:/home/pictures/file.fits .
One way this error can occur is if you have a space before the first path like below:
scp myUserName@HostName: /path/to/file /path/to/new/file ^
To fix, just take the space out:
scp myUserName@HostName:/path/to/file /path/to/new/file
simple steps you need to follow
1)scp -r user@host:/var/www/html/projectFolder /var/www/html/localsystem-project-folder
2)scp -r user@host:/var/www/html/projectFolder/filename.php /var/www/html/localsystem-project-folder/
here -r is for recursive traverse the director will help you without any error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With