The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Finding Hidden files and protecting the folder containing hidden files from deletion pochaw Shell Programming and Scripting 4 12-22-2007 01:33 AM
FTP - To handle error while transferring files mahalakshmi Shell Programming and Scripting 1 04-04-2007 03:56 AM
transferring files using ftp but mantaining the dates 435 Gavea Shell Programming and Scripting 4 07-23-2006 11:48 AM
transferring files to and from remote computer yogi1 UNIX for Dummies Questions & Answers 6 05-28-2006 09:58 PM
FTP session expiring when transferring files... Need some solution aarora_98 Shell Programming and Scripting 4 12-13-2005 01:28 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-12-2007
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,944
Transferring hidden files with scp

Is there a way to scp hidden files only ( with regex ) without specifying the name of the hidden files ?

Many thanks in advance !
  #2 (permalink)  
Old 01-12-2007
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,717
Define "hidden" file - one with a protection mask of 000 ?
  #3 (permalink)  
Old 01-12-2007
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,944
No,

files whose name starts with a "."
  #4 (permalink)  
Old 01-12-2007
funksen funksen is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2006
Location: Austria/Vienna
Posts: 430
scp .* host:/dir

you get error mes for directories . and .. but you can filter them out if you want
  #5 (permalink)  
Old 01-12-2007
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,944
Quote:
Originally Posted by funksen
scp .* host:/dir

you get error mes for directories . and .. but you can filter them out if you want

Thanks,
But this would copy all the files not only the hidden files (filenames starting with a "." )

Am trying to copy only the files whose name starts with a "."
like,
.profile
.env
  #6 (permalink)  
Old 01-12-2007
funksen funksen is offline Forum Advisor  
Registered User
  
 

Join Date: Nov 2006
Location: Austria/Vienna
Posts: 430
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
  #7 (permalink)  
Old 01-12-2007
srinivasan_85 srinivasan_85 is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 28
Hope this helps!

Hi,
I am using xargs to do the job! I hope this is wat u expected

ls -la | awk '{print $NF}' | egrep '^\.' | xargs -I {} -t scp {} some_machine:~/destination_folder

~Srini
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:45 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0