Quantcast
Channel: How to find multiple files with specific pattern using or in find command - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2

Answer by steeldriver for How to find multiple files with specific pattern using or in find command

$
0
0

You can use

! \( -name '.bashrc' -o -name '.profile' \)

Ex.

$ find /etc/skel ! \( -name '.bashrc' -o -name '.profile' \)
/etc/skel
/etc/skel/.mkshrc
/etc/skel/examples.desktop
/etc/skel/.kshrc
/etc/skel/.bash_logout

The quotes aren't actually necessary in this case but you should get in the habit of using them in the case that the search pattern contains glob characters.


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>