just an alternative to #7818 Show Sample Output
-exec sh -c 'var={}; do something with var' lets you do things in a sub-shell while it's faster to type, I'm not sure if dozens of subshells execute quicker than the while loops.
Allows for manual set of the CPU's frequency. First look at "cpupower frequency-info" for all the available frequency steps your processor can be set at. e.g. sudo cpupower frequency-set -f 1100MHz
The "find $stuff -print0 | xargs -0 $command" pattern causes both find and xargs to use null-delineated paths, greatly reducing the probability of either hiccuping on even the weirdest of file/path names.
It's also not strictly necessary to add the {} at the end of the xargs command line, as it'll put the files there automatically.
Mind, in most environments, you could use find's "-exec" option to bypass xargs entirely:
find . -name '*.jpg' -o -name '*.JPG' -exec mogrify -resize 1024">" -quality 40 {} +
will use xargs-like "make sure the command line isn't too long" logic to run the mogrify command as few times as necessary (to run once per file, use a ';' instead of a '+' - just be sure to escape it properly).
Took one of the samples, added capitalization and removes in between spaces. The final "echo" is just for readability. Cheers Show Sample Output
You can use \n in your inserted data to insert multiple lines. The leading number is the position in the file where you want the insert, so in this case a '1' indicates the top of the file.
Its possible to user a simple regex to extract de username from the finger command. The final echo its optional, just for remove the initial space Show Sample Output
This is a powershell command that returns the leaf part of the current svn url Show Sample Output
get the size of S3 bucket Show Sample Output
Pluralize a word, aka change from single to multiple; text formatting.
echo hamburgler | pluralize
Show Sample Output
This “sysload” alias converts the load average to percentages and divides them by the number of CPUs/cores. It may provide a more intuitive guesstimate of how much work the server is doing. Show Sample Output
The two lines below are for a BeanShell script so it can be executed under Linux and Cygwin. Also, bsh.jar must be in the CLASSPATH environment variable, or in the jre/lib/ext/ directory of the JVM. #! /bin/sh ///bin/true; exec java bsh.Interpreter "$0" "$@"
Renames all the jpg files as their timestamps with ".jpg" extension. Show Sample Output
Turns off the bluetooth hardware module. To turn it back on use `rfkill unblock bluetooth`. Works in Ubuntu, probably in other distros as well. I don't know if you need some special user permission to do this. It worked for me out of the box.
Just replace eth3 with the interface you want the MAC for. Show Sample Output
Bash function copies a file prefixed with a version number to a subdirectory Show Sample Output
on debian only
usage: alarmclock TIME TIME is a sleep(1) parameter which tells function how long to wait until raise the alarm.
Let's not forget awk! Show Sample Output
just an alternative to setting the size, this allows you to scroll up and see your previous commands in a given session but when you logout the history is not saved. That's the only advantage to doing it this way.. 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: