Check These Out
Most of the "most used commands" approaches does not consider pipes and other complexities.
This approach considers pipes, process substitution by backticks or $() and multiple commands separated by ;
Perl regular expression breaks up each line using | or < ( or ; or ` or $( and picks the first word (excluding "do" in case of for loops)
note: if you are using lots of perl one-liners, the perl commands will be counted as well in this approach, since semicolon is used as a separator
This will move a folder and merge it with another folder which may contain duplicates. Technically it's just creating hardlinks of everything in the folder, and after it's done, delete the source (with rm -r source/ ) to complete the move. This is much faster than, for example, using rsync to merge folders which would actually copy the entire contents and so for a lot of files would take much longer.
This uses macutils gcp port of cp so it can be used on osx/MacOS. If using in linux or some unix where cp includes the ability to create links with -l you can just use cp instead of gcp.
Generates a random 8-character password that can be typed using only the left hand on a QWERTY keyboard. Useful to avoid taking your hand off of the mouse, especially if your username is left-handed. Change the 8 to your length of choice, add or remove characters from the list based on your preferences or kezboard layout, etc.
$ vix /tmp/script.sh
Open a file directly with execution permission.
Put the function in your .bashrc
You can also put this in your vimrc:
$ command XX w | set ar | silent exe "!chmod +x %" | redraw!
and open a new file like this:
$ vi +XX /tmp/script.sh
This lets you replace a file or directory and quickly revert if something goes wrong. For example, the current version of a website's files are in public_html. Put a new version of the site in public_html~ and execute the command. The names are swapped. If anything goes wrong, execute it again (up arrow or !!).