Regex - match string to find hidden files on linux - Techist - Tech Forum

Go Back   Techist - Tech Forum > Computer Software > Programming
Click Here to Login
Closed Thread
 
Thread Tools Display Modes
 
Old 02-23-2011, 03:46 PM   #1 (permalink)
It's all just 1s and 0s
 
office politics's Avatar
 
Join Date: Jan 2004
Location: in the lab
Posts: 6,555
Send a message via MSN to office politics
Default Regex - match string to find hidden files on linux

HELP!

I'm looking to create a regex pattern that produces matches for hidden files on linux.

pattern i think should work
/\\home\\theusr\\\.?

string to match is the following (note the slashes are backslashes, the backups system uses these strings)
/\home\theusr\.hidden
/\home\theusr\.hidden2

but not
/\home\theusr\nothidden.txt


i found these links

Regular Expressions - a Simple User Guide


Senior Advisor - http://www.unix.com
__________________

office politics is offline  
Old 02-24-2011, 07:23 AM   #2 (permalink)
Seg Fault'n
 
Join Date: Jul 2005
Location: The dried husk where America came from
Posts: 5,801
Default Re: Regex - match string to find hidden files on linux

try
find /home/theuser -name '.*'
__________________

__________________


There are in order of increasing severity: lies, darn lies, statistics, and computer benchmarks. - diskinfo man page
"Get your money and let's go to court!" - Craig Mudie, MS
kmote is offline  
Old 02-24-2011, 07:51 AM   #3 (permalink)
It's all just 1s and 0s
 
office politics's Avatar
 
Join Date: Jan 2004
Location: in the lab
Posts: 6,555
Send a message via MSN to office politics
Default Re: Regex - match string to find hidden files on linux

I can't. I'm using a backup application that allows regex pattern matching. The goal is to exclude all files except any that are hidden. The dialog box has a check box for negate. So if I enter a regex pattern for the hiddens and check the box for negate, all will be good.

I've tried /\\home\\theusr\\\.*, but it produces a match for all files in the directory.
office politics is offline  
Old 02-24-2011, 07:53 AM   #4 (permalink)
Seg Fault'n
 
Join Date: Jul 2005
Location: The dried husk where America came from
Posts: 5,801
Default Re: Regex - match string to find hidden files on linux

It would, yeah. Try
/\\home\\theusr\\\..*
__________________


There are in order of increasing severity: lies, darn lies, statistics, and computer benchmarks. - diskinfo man page
"Get your money and let's go to court!" - Craig Mudie, MS
kmote is offline  
Old 02-24-2011, 08:18 AM   #5 (permalink)
It's all just 1s and 0s
 
office politics's Avatar
 
Join Date: Jan 2004
Location: in the lab
Posts: 6,555
Send a message via MSN to office politics
Default Re: Regex - match string to find hidden files on linux

dang it, i turn my head for a couple minutes and look what happens, lol. we came to the same conclusion. /\\home\\theusr\\\..*

good work.
office politics is offline  
Closed Thread

Thread Tools
Display Modes

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GIGABYTE Unveils Industry-leading AMD 800 Series Motherboards Osiris New Technology and Products 7 04-29-2010 06:42 PM
Printing a string backwards...string coming from JFileChooser(java help) wafflehammer Programming 3 02-08-2010 03:38 PM
C# regex help CrazeD Programming 15 06-02-2009 04:53 PM
javascript regex generator office politics Programming 5 02-21-2009 11:58 AM
Regex help jonmon6691 Programming 3 01-30-2007 03:10 PM



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -5. The time now is 01:10 PM.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2018, vBulletin Solutions, Inc.