Not a regular file scp что

Обновлено: 02.07.2024

если вывод root , то вы суперпользователь, и вы можете сделать копию файла с помощью:

в противном случае вы должны использовать sudo :

Если вы по-прежнему не можете писать в каталог, возможно, что:

    в каталоге включен флаг неизменности. проверить с lsattr .

каталог монтируется с правами только для чтения: введите в терминал:

cat /proc/mounts (или mount или cat /etc/mtab )

и проверьте вывод, если каталог смонтирован только для чтения.

Если вы находитесь в первом случае, измените атрибуты каталога с помощью chattr ;

scp gives "not a regular file"

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:

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?

18.1k 5 5 gold badges 60 60 silver badges 81 81 bronze badges 431 1 1 gold badge 4 4 silver badges 3 3 bronze badges maybe the path is wrong and should contain your Linux user name. /home/<user>/pictures maybe?

scp gives "not a regular file"

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:

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?

18.1k 5 5 gold badges 60 60 silver badges 81 81 bronze badges 431 1 1 gold badge 4 4 silver badges 3 3 bronze badges maybe the path is wrong and should contain your Linux user name. /home/<user>/pictures maybe?

8 Answers 8

I just tested this and found at least 3 situations in which scp will return not a regular file :

  1. File is actually a directory
  2. File is a named pipe (a.k.a. FIFO)
  3. File is a device file
11.3k 4 4 gold badges 45 45 silver badges 59 59 bronze badges

"/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:

19.4k 21 21 gold badges 72 72 silver badges 93 93 bronze badges This really helped me To copy a directory with scp, you have to supply the "-r" flag

One way this error can occur is if you have a space before the first path like below:

To fix, just take the space out:

3,221 3 3 gold badges 31 31 silver badges 47 47 bronze badges

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.


It is possible that you are working with a directory/folder.

If this is the case, here is what you want to do:

First, compress the folder. By running the command:

zip -r name_of_folder.zip name_of_folder

Then use the scp command normally to copy the file to your destination:

scp path/to/name_of_folder.zip server:localhost:/path/to/name_of_folder.zip

Enter your password if it prompts you for one.

Unzip the name_of_folder.zip with this command:

unzip name_of_folder.zip

That is it, you now have your folder in the destination system. By the way, this is for zip compression.

NOTE: If you are on Mac OS and you don't want to see resource files such as _MACOSX, you may run:

Meaning the above command should be used instead of that in step 1 above.

8 Answers 8

I just tested this and found at least 3 situations in which scp will return not a regular file :

  1. File is actually a directory
  2. File is a named pipe (a.k.a. FIFO)
  3. File is a device file
11.3k 4 4 gold badges 45 45 silver badges 59 59 bronze badges

"/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:

19.4k 21 21 gold badges 72 72 silver badges 93 93 bronze badges This really helped me To copy a directory with scp, you have to supply the "-r" flag

One way this error can occur is if you have a space before the first path like below:

To fix, just take the space out:

3,221 3 3 gold badges 31 31 silver badges 47 47 bronze badges

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.


It is possible that you are working with a directory/folder.

If this is the case, here is what you want to do:

First, compress the folder. By running the command:

zip -r name_of_folder.zip name_of_folder

Then use the scp command normally to copy the file to your destination:

scp path/to/name_of_folder.zip server:localhost:/path/to/name_of_folder.zip

Enter your password if it prompts you for one.

Unzip the name_of_folder.zip with this command:

unzip name_of_folder.zip

That is it, you now have your folder in the destination system. By the way, this is for zip compression.

NOTE: If you are on Mac OS and you don't want to see resource files such as _MACOSX, you may run:

Meaning the above command should be used instead of that in step 1 above.

8 Answers 8

I just tested this and found at least 3 situations in which scp will return not a regular file :

  1. File is actually a directory
  2. File is a named pipe (a.k.a. FIFO)
  3. File is a device file
11.3k 4 4 gold badges 45 45 silver badges 59 59 bronze badges

"/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:

19.4k 21 21 gold badges 72 72 silver badges 93 93 bronze badges This really helped me To copy a directory with scp, you have to supply the "-r" flag

One way this error can occur is if you have a space before the first path like below:

To fix, just take the space out:

3,221 3 3 gold badges 31 31 silver badges 47 47 bronze badges

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.


It is possible that you are working with a directory/folder.

If this is the case, here is what you want to do:

First, compress the folder. By running the command:

zip -r name_of_folder.zip name_of_folder

Then use the scp command normally to copy the file to your destination:

scp path/to/name_of_folder.zip server:localhost:/path/to/name_of_folder.zip

Enter your password if it prompts you for one.

Unzip the name_of_folder.zip with this command:

unzip name_of_folder.zip

That is it, you now have your folder in the destination system. By the way, this is for zip compression.

NOTE: If you are on Mac OS and you don't want to see resource files such as _MACOSX, you may run:

Meaning the above command should be used instead of that in step 1 above.

scp gives "not a regular file"

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:

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?

18.1k 5 5 gold badges 60 60 silver badges 81 81 bronze badges 431 1 1 gold badge 4 4 silver badges 3 3 bronze badges maybe the path is wrong and should contain your Linux user name. /home/<user>/pictures maybe?

Читайте также: