Show file count into directories. Usefull when you try to find hugh directories that elevate system CPU (vmstat -> sy) Show Sample Output
It works extremely fast, because it calculates md5sum only on the files that have the same size and name. But there is nothing for free - it won't find duplicates with the different names. Show Sample Output
Use find . -iname "*.py" -type f -print0 | xargs -0 sed -ne 's/^\([ \t]*\)print \(.*\)$/\1print(\2)/p' to see what would be changed.
Changes files like "temp (2).txt" to "temp.txt". Does not overwrite files that already exist.
I needed to find a command to delete huge numbers of files without intensive cpu load, that command does the job :) The purpose of "+" at then end of the line, tells rm to delete multiple files at once
This is a regular find with the -wholename parameter to let it know what name pattern he need to look and then the -mmin -15 to know the last 15 minutes. Show Sample Output
It's change the group id of all the files on your system that have the OLDGID group as the owner group by the new NEWGID. But first do this:
Document which files will be changed, use:
find / -gid OLDGID ! -type l > resplado-gid.txt
Be sure to disconnect users from the old group.
Stop demons or services associated with the group.
Be sure the new group exist and take note of GID
Find (by regular expression) and compress (xzip) catalogs then remove source catalogs
if you have less free inode space alert in your monitoring app you can use this command to find the any directory with too many files and subdirectory . Show Sample Output
This uses bash's Process Substitution. It is necessary to give the full path of the file, thus why the filenames are filtered through realpath. In theory, this command should also work with mplayer and mplayer2 (using -playlist instead of --playlist). Modifications: - You can search specific directories by inserting them between "find" and "-type". - Edit the parameter of "-iname" to change the type of file searched for. - Remove everything after "realpath" to play the files in order.
Find music types on your current location and will play them randomly with mpv/mplayer.
So simple
Very useful to get rid of backup files or wrong extension files that lure in your folders In this example first I do two searches for all filenames of the two extensions .jpg and .png, then delete the extension and only output the now duplicate files. I loop with these results and print a log and delete the file with the extension I dislike. Show Sample Output
I wanted to count and display the top directories containing JavaScript files in some of my project. Here it is. Maybe it can be written to more simply syntax by using find -exec...
This useful command will help to detect bitrate of each audio file in folder where it will run for. Show Sample Output
Finds javascript lodash/underscore methods in source code. It's not perfect as can be ascertained from the last entry in the output. Would be interested if somebody improves this. Show Sample Output
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: