Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find -type f with restrictions

Tags:

linux

find

unix

I have the following find command to find all files in a Volume:

find ./ -type f

How would I exclude all files that start with . ? Also, I do want to include folders that being with . For example:

  • Include .Trashes/file.php
  • Do not include folder/.hidden_file.php

What would be the correct find command for this?

like image 361
David542 Avatar asked Feb 10 '13 18:02

David542


People also ask

How do you solve a function with restrictions?

Identify any restrictions on the input. If there is a denominator in the function's formula, set the denominator equal to zero and solve for x . If the function's formula contains an even root, set the radicand greater than or equal to 0 and then solve.

What is called restriction of F to A?

Then the restriction of the function f to A is defined as another function defined in the following form: If A is a subset of X, then the restriction of the function f to A is the function f|A: A→Y; this means f|A(x) = y, where xϵA and yϵY.


1 Answers

To exclude all files whose names begin with . :

find ./ -type f ! -name '.*'

This will search in all directories (even if their names start with a dot), descending from the current directory, for regular files whose names do not begin with a dot (! -name '.*').

like image 98
Eric Avatar answered Sep 22 '22 17:09

Eric