Mirror every lvol in vg00 in hp-ux 11.31
man find: If no paths are given, the current directory is used. - Can anybody tell me why so many people are typing the dot?
lists the files found by find, waits for user input then uses xdg-open to open the selected file with the appropriate program.
usage: findopen path expression [command]
With the third optional input you can specify a command to use other than xdg-open, for example you could echo the filename to stdout then pipe it to another command.
To get it to work for files with spaces it gets a bit messier...
findopen() { files=( $(find "$1" -iname "$2" | tr ' ' '@') ); select file in "${files[@]//@/ }"; do ${3:-xdg-open} "$file"; break; done }
You can replace the @ with any character that probably wont be in a file name.
Removes the given string from all files under the given path - in this case the path given is "." This demonstrates the characters that must be escaped for the grep and sed commands to do their work correctly. Very handy for fixing hacked html files.
find and normal files and list them sorting with modification time without group l: with detailed information t: sort with modification time r: reverse order h: show file's size in human-readable format, such as K(kilobytes), M(megabyes) etc. g: do not show group Show Sample Output
The thunderbird message datastores get corrupt some times causing random failures, compaction to fail and general suck in thunderbird. Removing them causes thunderbird to rebuild the indexes and makes things quick again.
this is great if you loose you ssh connection (with out a screen session) or are working on a laptop with a bad battery, or just a power outage. Modifications: you may not need the -print; the mtime is last modified time in days
This will list all symlinks that are directories under the current directory. This will help you distinguish them from regular files.
This version uses the indent C formatting utility. Doesn't appear to be included with ubuntu. But CentOS and MacOS have it.
This command will remove only files, not directories: if you wish to remove both directories and files, just remove '-type f' from command above
Returns any file in the folder which would be rejected by Gmail, if you were to send zipped version. (Yes, you could just zip it and knock the extension off and put it back on the other side, but for some people this just isn't a solution) Show Sample Output
Removing .svn directories without a pipe
Show the top file size in human readable form
Unless you have files that include 'svn' in them, this should provide enough information to be useful. If you need to be certain, add the leading dot in the search pattern
This command, when run from the directory containing "filename", will remove the file and any hard or symbolic links to the file.
If you have a folder with thousand of files and want to have many folder with only 100 file per folder, run this. It will create 0/,1/ etc and put 100 file inside each one. But find will return true even if it don't find anything ... Show Sample Output
One of my friends committed his code in the encoding of GB2312, which broke the build job. I have to find his code and convert.
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: