gitstart ~/path/to/dir
Initialized empty Git repository in /home/user/path/to/dir/.git/
Smaller Code Better Runtime
Bash function copies a file prefixed with a version number to a subdirectory Show Sample Output
Here was simple.
if dir1 does not exists
creates 100 directories f(1-100) with a file in each matched to the directory (/f1/myfile1, .. /f98/myfile98,/f99/myfile99/,/f100/myfile100,etc ) Show Sample Output
Creates a directory and then cds into it directly Show Sample Output
I realise that this is just a reiteration of another entry (regardless of whether I came up with all this all by myself), but I would like present my additional alias' in context as a method of managing your directories. Rather convenient.
Only requirement is bash shell. No functions needed. Show Sample Output
The directories are created in the local host with the same structure below of a remote base directory, including the 'basedir' in case that it does not exists. You must replace user and remotehost (or IP address) with your proper values ssh will ask for the password of the user in remotehost, unless you had included properly your hostname in the remote .ssh/known_hosts file. Show Sample Output
Set variable 'input' to a set of flac files.
this command extracts an initrd files into the "tmp" directory
Given a cbr file which is rar compressed, get a cbz file which is zip compressed.
Great for backup / restore scripts. May want to remove the %M/%S to group backups by hour. If using a script, set a variable earlier with the date command, then reference that variable. Otherwise, time will keep on rolling ;-) declare -rx script_start_time="$(date '+./%Y/%m/%d/%H/%M/%S')" mkdir -p "$script_start_time" Show Sample Output
Ideal for shuffling e.g. photo's with Imagemagick's montage, for instance in combination with: montage -density 300 -resize 512x384 -mode concatenate -tile 7x7 shuffled/* shuffled/output.pdf you can generate a PDF montage of 7x7 random photo's per page with properly scaled images. If there are other files than photo's in your folder, replace pattern './*' with for instance './*.jpeg' to select the file type you want.
Use `date +%B` for month name. See more in man date. Show Sample Output
This is a no brainer command to make a direcory, substitute with the name of your directory. Show Sample Output
fstrim is usually used on SSDs but can also be used to remove useless bits from file system images. This is most helpful if the compressed disk image is intended to be distributed, since it will be smaller than an untrimmed compressed image. Show Sample Output
The shell {} operator is great for this. Here's an example with three directories enclosed in {}:
It happened to me that I got a season of a tv-show which had all files under the same folder like /home/blah/tv_show/season1/file{1,2,3,4,5,...}.avi
But I like to have them like this:
/home/blah/tv_show/season1/e{1,2,3,4,5,...}/file{1,2,3,4,5,...}.avi
So I can have both the srt and the avi on one folder without cluttering much. This command organizes everything assuming that the filename contains Exx where xx is the number of the episode.
You may need to set:
IFS=$'\n'
if your filenames have spaces.
Bulk downloads the comic strip JPG files for the adult cartoon Savitabhabhi, storing each set in it's own folder. Requires manual removal of "non-image" files that maybe created because each series may differ in length. The command can be easily adapted for UNIX flavours. You need to have cURL in your path.
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: