Good old bracket expansion :-) For large numbers of files, "rename" will spare you the for-loop, or the find/exec...
In order to write bash-scripts, I often do the task manually to see how it works. I type ### at the start of my session. The function fetches the commands from the last occurrence of '###', excluding the function call. You could prefix this with a here-document to have a proper script-header. Delete some lines, add a few variables and a loop, and you're ready to go. This function could probably be much shorter...
should do the same as command #12875, just shorter.
Somehow, i prefer forcing to rm interactively to accidently rm'ing everything...
Same game as #10096 . loop as many times as you like.
Needs Bash4. Found at http://stackoverflow.com/questions/2264428/converting-string-to-lower-case-in-bash-shell-scripting alongside a few other tricks.
you may as well use shutdown -h 18:32 to shutdown your machine at 18:32.
-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.
function for .bash_aliases that prints a line of the character of your choice in the color of your choice across the terminal. Default character is "=", default color is white.
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: