Monday, January 7, 2013

Using RegEx in find command

Below shown are the examples for using Regular Expression in 'find' command:

[ashok@linuxhost workdir]$ find . -type f -regex ".*[0-9]+.txt" -print 2> /dev/null
./1322143.txt
./anything_134.txt
./12345_837.txt
./something10984.txt

[ashok@linuxhost workdir]$ find . -type f -regex ".*/[0-9]+.txt" -print 2> /dev/null
./1322143.txt
[ashok@linuxhost workdir]$

3 comments:

  1. Hi are using Wordpress for your site platform? I'm new to the blog world but I'm
    trying to get started and create my own.
    Do you require any coding knowledge to make your own blog?
    Any help would be greatly appreciated!

    my webpage - this is great
    My website > read more here

    ReplyDelete
    Replies
    1. This blog is supported by Google, you can use it with your google account.

      Delete
  2. thank you for sharing your blog. visit our website.
    Linux Admin Training in Austin

    ReplyDelete