Got the idea from there http://fixunix.com/questions/15902-bash-checking-if-env-var-set.html Show Sample Output
On the Mac, the 'ls' function can sort based on month/day/time, but seems to lack ability to filter on the Year field (#9 among the long listed fields). The sorted list continuously increases the 'START' year for the most recently accessed set of files. The final month printed will be the highest month that appeared in that START year. The command does its magic on the current directory, and suitably discards all entries that are themselves directories. If you expect files dating prior to 2002, change the START year accordingly.
This gets the Nth argument in the last line of your history file. This is useful where history is being written after each command, and you want to use arguments from the previous command in the current command, such as when doing copies/moving directories etc. I wrote this after getting irritated with having to continually type in long paths/arguments. You could also use $_ if all you want is the last argument. Show Sample Output
If you want to test output, run it like this: for fn in *.epub; do echo mv \"$fn\" \"`echo "$fn" | sed -E 's/\.*\/*(.*)( - )(.*)(\.[^\.]+)$/\3\2\1\4/' | sed -E 's/(.*) ([^ ]+)( - )(.*)/\2, \1\3\4/' `\";done > rename.txt Show Sample Output
drop first column with perl "$#F" means a index of last column(start from 0). One can easily handle range of columns like "[3..6]"
This can help with serious GUI lockups in KDE. It will only restart Plasma + widgets, not your session, so all your programs will stay running.
if there are multiple monitors, this command uses multiple lines Show Sample Output
makes sure not to skip children nodemodules credit: https://coderwall.com/p/guqrca/remove-all-node_module-folders-recursively
scale define the number you want after comma Show Sample Output
Use find's exec and reduce the need for multiple evals with a progn wrapper.
plain and simple Show Sample Output
Takes effect immediately.
you can't reliably use diff against -r HEAD to test whether a file matches the head of the trunk.
Create empty file
manage directory stack 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: