In linux , while we copy files from one host to another host using scp , we may get error like below

name :  not a regular file

Solution: Add option “-r”

Most probably you are trying to copy a directory , in this case you need to use option -r

scp -r directory  [user@]host:[path]

Where:-r means recursively copy entire directories.

In linux , there are different types of files , like regular file , directory, character file , socket file ,etc.

regular file means the file contains actual data like text or video , image,etc.

and directory is different file type which contains names and addresses of files.

Or we can say by default scp treats the file as regular file , so option -r must be used to copy directory.