Transferring hidden files with scp


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Transferring hidden files with scp
# 8  
Old 01-12-2007
Quote:
Originally Posted by funksen
a plain file that starts with a . is automatically hidden

for avoiding error mes you can use

scp $(ls -la | grep -v "^d" | awk '{print $9}' | grep "^\.") hostname:/dir

Thank you very much of the reply.

but am looking for a way to do that in regex.

(Other way of selecting hidden files
Code:
ls -a1 | awk '/^\./ { print }'

)
# 9  
Old 01-12-2007
Don't know if this helps or not, but you can get all the files in the current directory beginning with "." using find:
Code:
find . -type f -name ".?*"

EDIT: Note the bold above; without the -type flag, directories beginning with "." would also be selected.

Last edited by Glenn Arndt; 01-12-2007 at 11:38 AM.. Reason: Code change
# 10  
Old 01-12-2007
Quote:
Originally Posted by matrixmadhan
Thank you very much of the reply.

but am looking for a way to do that in regex.

(Other way of selecting hidden files
Code:
ls -a1 | awk '/^\./ { print }'

)
but it's not filtering directories out
I give up and watch the thread Smilie
# 11  
Old 01-12-2007
Do you want to include hidden directories or no? You can do:
Code:
ls -Ad .[!.]*

That returns all files in the current directory that begin with ".", but do not begin with ".." or wholly consist of "..". Hidden directory names are returned. If you have files like "....filename", they would be ignored.
# 12  
Old 01-16-2007
Quote:
Originally Posted by funksen
but it's not filtering directories out
I give up and watch the thread Smilie

Your point is valid and I had given the command based on the practice only.
Normally we dont create a directory beginnng with a "."

Rest the command would take care
# 13  
Old 01-16-2007
Quote:
Originally Posted by matrixmadhan
Your point is valid and I had given the command based on the practice only.
Normally we dont create a directory beginnng with a "."
Many programs do so inside user home directories..
# 14  
Old 01-16-2007
Quote:
Originally Posted by Corona688
Many programs do so inside user home directories..
Yes, which is why my "solution" is flawed. My home directory, for example, has an .elm/ directory in it.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Transferring files to directories

I have a large number of files with file names of the format iv.epoz.hhe.d.2018.028.000000.sac iv.epoz.hhn.d.2018.028.000000.sac iv.epoz.hhz.d.2018.028.000000.sac iv.epoz.hhe.d.2018.029.000000.sac iv.epoz.hhn.d.2018.029.000000.sac iv.epoz.hhz.d.2018.029.000000.sac... (4 Replies)
Discussion started by: kristinu
4 Replies

2. Shell Programming and Scripting

Rsync - how to copy hidden folder or hidden files when using full path

Hello. I use this command : rsync -av --include=".*" --dry-run "$A_FULL_PATH_S" "$A_FULL_PATH_D"The data comes from the output of a find command. And no full source directories are in use, only some files. Source example... (2 Replies)
Discussion started by: jcdole
2 Replies

3. Shell Programming and Scripting

How can we overcome Broken pipe error during scp,SFTP,Rsync while transferring big files.?

Hello All, Hope all are doing well. We use scp (some times sftp and rsync also) for transferring big files (around 2GB each ) from 1 Network to another Network. The Issues which we face :- During transfer some times( Once in 1 week (or twice)) , the speed of transfer gets down to 30 kb/s,... (2 Replies)
Discussion started by: Upendra Bhushan
2 Replies

4. AIX

Rcp error while transferring files

i am trying to use a rsh script that uses the rcp command to copy files from server to server but it always produce the following error: HOSTNAME: protocol failure due to unexpected closure from server end Error: failed to copy /test to HOST2 system Error: failed to execute command on remote... (5 Replies)
Discussion started by: Portabello
5 Replies

5. Shell Programming and Scripting

Script for transferring files

Hi Guys, I have to transfer a few files in my system . The commands to be used are as follows . Will it be possible to send the output of the following in the form of a mail . cd /export/home/teja ls -lrt Quote.java* mv Quote.java Quote.java.20121023 cp /tmp/Quote.java . ls -lrt... (2 Replies)
Discussion started by: Ravi_Teja
2 Replies

6. UNIX for Dummies Questions & Answers

Transferring files from one linux server into another

Hello , I want to transfer files from one linux server into another , I got it working using SCP command , but I have to type in password for each and every file . All the remote severs have the same password , so is there a way that I can transfer all these files by typing my password only once ? (5 Replies)
Discussion started by: RaviTej
5 Replies

7. AIX

Transferring files between Windows and AIX

How do I transfer Plain Text and/or BMP image files between my WindowsXP PC and my AIX 4.1 PowerPC? I have no network or USB options, just a Floppy disk drive and a CD drive on each machine. Is it possible at all? Any help would be gratefully received:) (7 Replies)
Discussion started by: Pennant Man
7 Replies

8. Shell Programming and Scripting

Finding Hidden files and protecting the folder containing hidden files from deletion

Hi. I have a script which is deleting files with a particular extension and older than 45 days.The code is: find <path> -name "<filename_pattern>" -mtime +45 -exec rm {} \; But the problem is that some important files are also getting deleted.To prevent this I have decide to make a dummy... (4 Replies)
Discussion started by: pochaw
4 Replies

9. UNIX for Dummies Questions & Answers

transferring files to and from remote computer

Hi all, i first have to ssh into my university account and then through there another ssh into my office computer, from my home computer. I have been trying to transfer files to and from with no such luck. How do i send a file from home to my office computer. Do I have to send it to my... (6 Replies)
Discussion started by: yogi1
6 Replies
Login or Register to Ask a Question