Topic Contributors
creator avatar  
mreschke
Matthew Reschke
Site Developer
Created: Feb 18th, 2009
Updated: Nov 27th, 2010
File
Download Selected (zip)
Download Selected (tar.gz)
Edit
Select All
Select None
View
Detail
Detail Preview
Icons
Preview
Show Hidden
Hide Hidden
Full Manager
Reset Defaults
Open In New Tab
Open In New Window
List Archive Contents
Download File
Open
Download Folder (as .zip)
Linux Find Command
Post # 132 permalink Topic #132 by mreschke on 2009-02-18 00:36:25 (viewed 384 times)

List all files[-][- -][++]

Code Snippet
find ./ -name "*.mp3"    # this is casesensative
find ./ -iname "*.mp3"  # this one is case-insensative

find / -type d -print (to list only directories)
find / -type l -print (to list only soft links)
find / -type b -print (to list only bliock special files)
find / -type f -print (to list only regular files)'

List files with excluded extensions[-][- -][++]

Code Snippet
find ./ -not -iname *.mp3 -not -iname *.jpg -not -iname *.jpeg

like to find all junk thats not music or music related

find /mnt/seagate750/\(Tag\ Ready\)\ -\ QServer/ -type f -not -iname *.mp3 -not -iname *.jpg -not -iname *.jpeg -not -iname *.db -not -iname *.ini -not -iname *.txt -not -iname *.doc -not -iname *.gif -not -iname *.png -not -iname *.m3u|sort

Find all files by a user or group[-][- -][++]

Code Snippet
find / -user mreschke
find / -group admin
find / -uid 501

Find all files by user and change that user[-][- -][++]

Find all files owned by a user, and change that user on all files to another user
http://snipplr.com/view/14971/change-ownership-of-all-files-owned-by-user1-to-user2/

Code Snippet
sudo find /home -user mreschke -exec chown newuser {} \;