Check These Out
Shorter version, works with multiple words.
probably just like 1204, but uses tee as a filter (+ I actually understand how this one works)
Copy the current path. Use -selection clipboard to copy the string to clipboard.
If BREs can be used, this sed version will also get the job done.
Note: the tar archive must not exist in order to create it. If exists it will only be updated and no already existent files in present search will still remain in the tar archive. The update option has to be used instead of create because the command tar may be executed more than once depending on the number of arguments that find throws. You can see maximum number of arguments with 'getconf ARG_MAX'
This is just a proof of concept: A FILE WHICH CAN AUTOMOUNT ITSELF through a SIMPLY ENCODED script. It takes advantage of the OFFSET option of mount, and uses it as a password (see that 9191? just change it to something similar, around 9k). It works fine, mounts, gets modified, updated, and can be moved by just copying it.
USAGE: SEE SAMPLE OUTPUT
The file is composed of three parts:
a) The legible script (about 242 bytes)
b) A random text fill to reach the OFFSET size (equals PASSWORD minus 242)
c) The actual filesystem
Logically, (a)+(b) = PASSWORD, that means OFFSET, and mount uses that option.
PLEASE NOTE: THIS IS NOT AN ENCRYPTED FILESYSTEM. To improve it, it can be mounted with a better encryption script and used with encfs or cryptfs. The idea was just to test the concept... with one line :)
It applies the original idea of http://www.commandlinefu.com/commands/view/7382/command-for-john-cons for encrypting the file.
The embedded bash script can be grown, of course, and the offset recalculation goes fine. I have my own version with bash --init-file to startup a bashrc with a well-defined environment, aliases, variables.
pushd and popd are your friends, but sometimes they're just incompatible with the way one works...
Two shell functions:
bm bookmarkname - "bookmarks" the current directory, just 'cd $BMbookmarkname' to return to it.
forget bookmarkname - unsets the 'bookmarkname' variable. It isn't mandatory, they cease to exist when the session ends.
5 helpful aliases for using the which utility, specifically for the GNU which (2.16 tested) that is included in coreutils.
Which is run first for a command. Same as type builtin minus verbosity
$ alias which='{ command alias; command declare -f; } | command which --read-functions --read-alias'
Which (a)lias
$ alias whicha='command alias | command which --read-alias'
Which (f)unction
$ alias whichf='command declare -f | command which --read-functions'
Which e(x)ecutable file in PATH
$ alias whichx='command which'
Which (all) alias, function, builtin, and files in PATH
$ alias whichall='{ command alias; command declare -f; } | command which --read-functions --read-alias -a'
# From my .bash_profile http://www.askapache.com/linux-unix/bash_profile-functions-advanced-shell.html
Joins each line that end with backslash (common way to mark line continuation in many languages) with the following one while removing the backslash.