How to hide "dot" files

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

Post Reply
MKairys
Bronze Member
Bronze Member
Posts: 142
Joined: 2003 Apr 15, 15:39
Location: Boulder, Colorado

How to hide "dot" files

Post by MKairys »

I've really never used filter expressions, but now I have a use for them but I can't figure out how to do it.

I want to hide files and folders in my home directory that start with "." Any suggestions?
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: How to hide "dot" files

Post by Kilmatead »

There is no way to permanently hide them (unless you set their attributes to "hidden"), but you can set a visual filter to temporarily get them out of the way. The "hidden" approach (Actions -> Set Attributes) is probably what you want, but the following is much more fun in an evil academic sort of way. :D

Use <Alt+H> (View -> Visual Filter -> Rule Based) and in the filter dialogue that opens make sure all the fields are blank, then double-click on the "Additional Rules" section, and under "Property" select Name, in the matching field itself you put "^\." (without the quotes), tick both boxes (Verbatim and Regular Expression) and also the radio button for NOT under Boolean Context.

Basically, make it look like this:

Image

Save the filter (if desired), and sauté to taste.

By way of long boring explanation, this is just a regular expression (a goofy and complex system of matching stuff), where the "^" character means "match only the beginning of the text", followed by a "\" which "escapes" the period (meaning use an actual period), because otherwise (in regular expressions) the period-character itself means something completely different. The boolean NOT just means "show everything that does not match the regex pattern". Et voilà.

You can find out more about regular expressions (and other ways to "do your head in") at your nearest Google prompt. They take a bit of getting used to, but unlike Sudoku puzzles they're actually useful for something other than staving off the Alzheimers. :shrug:

(And if Nikos would get his act together and implement either the DEELX or PCRE regex systems into x2, they would be even more useful.)
MKairys
Bronze Member
Bronze Member
Posts: 142
Joined: 2003 Apr 15, 15:39
Location: Boulder, Colorado

Re: How to hide "dot" files

Post by MKairys »

Thanks very much! A visual filter is just what I wanted but I couldn't bludgeon the dialog into working for me ;)
User avatar
nikos
Site Admin
Site Admin
Posts: 15791
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Re: How to hide "dot" files

Post by nikos »

what about a simple (no regexp) wildcard
-.*
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: How to hide "dot" files

Post by Kilmatead »

Where's the evil academic fun in that? Nowhere, that's where. :D

Curiously, it only works from a proper filter - if you type it in the addressbar it won't work on folders (only files), which seems discriminatory. I'm sure there's a boring reason for that which I've simply forgotten, but still... :shrug:
User avatar
nikos
Site Admin
Site Admin
Posts: 15791
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Re: How to hide "dot" files

Post by nikos »

it is customary for plain filters that go in the addressbar to work only on files, don't know why but i had it this way since 2xexplorer
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: How to hide "dot" files

Post by Kilmatead »

It was also rather curious that x2 wouldn't let me create any "." prefixed files without also giving them an extension too - which was especially weird as it has the same proscription for folders. Folders with forced extensions? What madness you inhabit!

I guess maybe you just really hate linux. :wink:
User avatar
FrizzleFry
Platinum Member
Platinum Member
Posts: 1241
Joined: 2005 Oct 16, 19:09

Re: How to hide "dot" files

Post by FrizzleFry »

I think that is inherited from WE... you can rename files/folders to .whatever using Ctrl-F2
Kilmatead
Platinum Member
Platinum Member
Posts: 4578
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: How to hide "dot" files

Post by Kilmatead »

Ah - true. I'm a right-click-man meself, so things like <Ctrl+F2> just don't occur to my lizard-brain. (And <F7> / <F8> use WE by default, so I never got the chance when creating test-subjects.)

Still, I would prefer to envision Nikos sitting hunched over his keyboard in his withered old island fishing shack plotting the downfall of Linux because it ran over his dog when he was six and he's harboured a grudge ever since. I can even see the leak that lets the rain through the same two boards in the roof during monsoon season which he stubbornly refuses to fix (even though it's directly over his laptop) just because a branch fell from that same tree the boards came from years before and flattened the dog he had previous to the Linux attack. Which makes him 0-for-two in the doggie department. It just goes to show you never know what motivates a deviously determined fellow.

I mean, he listens to Prince records for God's sake! Do you really think a file-manager made by a man who listens to Prince is securely founded on reliably rational fundamentals? I think not. :wink:
Post Reply