Txt

Byte sized tech know-how.

  • Home
  • About

Tag Archives: find

25 Jun

Replacing in Found Files

Replace one string by another in all file found by find.


find . -name *whatyouwant* -exec perl -pi.bak -e 's/TEXT_TO_REPLACE/TEXT_TO_REPLACE_IT_WITH/g' {} \;
admin Posted in Command Line, Linux, Perl command, find, Linux, Perl, replace, string, text Leave a comment
18 May

Find Link Files

Use this command to find all the links in the current directory…


find . -lname "*"
admin Posted in Command Line, Linux command, file, find, link, Linux Leave a comment
15 May

Locate Files With Names Matching A Regexp

You can use locate to find files with name that matches a said regexp…


locate -i -r '\.jpg$'
admin Posted in Command Line, Linux command, expression, file, find, Linux, locate, name, regex, regexp, regular Leave a comment
08 May

Find files of a specific mime-type

Use this command to find files of a given mime-type. In this example, we are looking for video files…


find -type f -print0 | xargs -0 file -i | grep -i video

And, by the way, this command, and the last two commands were sponsored by Mahesh. Happy now?

admin Posted in Command Line, Linux command, find, grep, Linux, mime, type, video, xargs 1 Comment
14 Jan

Find Alsa Version

Find the version of alsa using this command…


cat /proc/asound/version

Thanks to Sreenath(Hacking With Debian) for this tip.

admin Posted in Command Line, Linux alsa, command, filler, find, Linux, sound, version 1 Comment
23 Oct

Optimized Grep Searching

Grep that searches recursively, ignores binary files, and doesn’t look inside Subversion hidden folders.


grep -Ir --exclude="*\.svn*" "pattern" *
admin Posted in Command Line, Linux command, exclude, find, grep, Linux, pattern, search, text Leave a comment
16 Sep

Archive all files with a given extension

Find all files with ‘.log’ extention and make an bzip archive


find /var/log -name '*.log' | tar cv --files-from=- | bzip2 > log.tar.bz2
admin Posted in Command Line, Linux bzip2, compress, extension, find, log, tar Leave a comment
07 Jul

Remove SVN Info from a Folder

This command removes the SVN data from a folder.


find -name .svn -exec rm -rf {} \;
admin Posted in Code, Command Line, Linux delete, find, remove, subversion, svn 2 Comments
10 Jun

Exclude Removable Partitions from a ‘find’ Search

Search files with ‘.rpm’ extension ignoring removable partitions as cdrom, pen-drive, etc.


find / -xdev -name \*.rpm
admin Posted in Command Line, Linux command, exclude, find, Linux, partition, remove Leave a comment
30 May

Find New Files

Search files created or changed within 10 days


find /usr/bin -type f -mtime -10
admin Posted in Command Line, Linux command, date, find, Linux, modified, search, time Leave a comment

Post navigation

← Older posts

Categories

  • Code
  • Command Line
  • Configuration
  • CSS
  • HTML
  • internet
  • JavaScript
  • Linux
  • Mobile
  • Perl
  • PHP
  • Python
  • Ruby
  • Uncategorized

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Fruitful theme by fruitfulcode Powered by: WordPress
↑