* grep -i leaves only mp3 files (case insentitive) * sort -R randomizes list (may use GNU 'shuf' instead). * the sed command will add double quotes around each filename (needed if odd characters are present)
Uses line-porcelain in git blame, which makes it easier to parse the output.
for debian/ubuntu
Tired of front end developers using short open tags in your views? This will replace all instances of
It requires https://jqplay.org/, that comes with brew: brew install jq Show Sample Output
Finds duplicates based on MD5 sum. Compares only files with the same size. Performance improvements on:
find -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate
The new version takes around 3 seconds where the old version took around 17 minutes. The bottle neck in the old command was the second find. It searches for the files with the specified file size. The new version keeps the file path and size from the beginning.
The difference between the original version provided and this one is that this one works rather than outputting a wget error
This command line detect ldap hosts, by mandatory dns entry, then ping them to detect response average. based on ping response average it sorts and print the faster server in first output line Show Sample Output
Get information of volume labels of bitlocker volumes, even if they are encrypted and locked (no access to filesystem, no password provided). Note that the volume labels can have spaces, but only if you name then before encryption. Renaming a bitlocker partition after being encrypted does not have the same effect as doing it before. Show Sample Output
Find recursively all files in ~/Notes with the extension '.md' and pipe that via xargs to rename command, which will replace every '.md' to '.txt' in this example (existing files will not be overwritten).
https://wuseman.github.io/wcloner/
Kill all processes with foo in them. Similar to pkill but more complete and also works when there is no pkill command. Works on almost every Linux/Unix platform I have tried.
rpm, sometimes, is not wildcard friendly. To search files installed from package this could be useful. change PACKAGENAME to any package do you want to search Show Sample Output
Removes all unversioned files and folders from an svn repository. Also:
svn status --no-ignore | grep ^I | awk '{print $2}' | xargs rm -rf
will remove those files which svn status ignores. Handy to add to a script which is in your path so you can run it from any repository (a la 'svn_clean.sh').
-t, --target-directory=DIRECTORY (copy all SOURCE arguments into DIRECTORY).
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: