Přejít na menu

GNU find

Správa článků

Vyhledávání Vyhledávání
25.2.2017 16:40
,
Počet přečtení: 598
Files finding utility.

Searching by filenames

How to match the filename of file "my_directory/myfile123.txt"

find my_directory -name *fil*
find my_directory -name *.txt*
find my_directory -name *.txt

Using regexps

find my_directory -regexp ".*le[0-9][0-9][0-9].*"

Does not work:

  • \d\d\d
  • [0-9]{3} (unless you use the switch: -regextype posix-extended)

Searching by modification datetime

Find all files modified in last threee days:

find -mtime -3

Exec the command

find src -name "*.gz" -exec rm {} \;

Vytvořil 25. února 2017 v 16:57:48 mira. Upravováno 2x, naposledy 14. března 2017 v 16:12:05, mira


Diskuze ke článku

Vložení nového komentáře
*
*
*