The UNIX and Linux Forums  

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-21-2007 10:33 PM
FTP - To handle error while transferring files mahalakshmi Shell Programming and Scripting 1 04-04-2007 12:56 AM
transferring files using ftp but mantaining the dates 435 Gavea Shell Programming and Scripting 4 07-23-2006 08:48 AM
transferring files to and from remote computer yogi1 UNIX for Dummies Questions & Answers 6 05-28-2006 06:58 PM
FTP session expiring when transferring files... Need some solution aarora_98 Shell Programming and Scripting 4 12-13-2005 10:28 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 01-12-2007
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
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 }'
)
Reply With Quote
Forum Sponsor
  #9  
Old 01-12-2007
Glenn Arndt's Avatar
Anomalous Lurker
 

Join Date: Feb 2006
Location: Indianapolis, IN
Posts: 255
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 08:38 AM. Reason: Code change
Reply With Quote
  #10  
Old 01-12-2007
Registered User
 

Join Date: Nov 2006
Location: Austria/Vienna
Posts: 235
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
Reply With Quote
  #11  
Old 01-12-2007
Glenn Arndt's Avatar
Anomalous Lurker
 

Join Date: Feb 2006
Location: Indianapolis, IN
Posts: 255
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.
Reply With Quote
  #12  
Old 01-15-2007
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,610
Quote:
Originally Posted by funksen
but it's not filtering directories out
I give up and watch the thread

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
Reply With Quote
  #13  
Old 01-16-2007
Registered User
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 989
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..
Reply With Quote
  #14  
Old 01-16-2007
Glenn Arndt's Avatar
Anomalous Lurker
 

Join Date: Feb 2006
Location: Indianapolis, IN
Posts: 255
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.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:02 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0