Skip to main content

Posts

Showing posts with the label files

Bash script to sort files into folders by filetype

This script will list the files in the current directory, create (if needed) a folder for each type of file and them move the files into their respective folders: #!/bin/bash file -N --mime-type -F"-&-" * | grep -v $0 | awk -F"-&-" BEGIN{q="47"} { o=$1 #gsub("/","_",$2); # uncomment to make folders like "image_jpeg" instead of "image/jpeg" sub("^ +","",$2) if (!($2 in dir )) { dir[$2] cmd="mkdir -p "$2 print cmd #system(cmd) #uncomment to use } files[o]=$2 } END{ for(f in files){ cmd="mv "q f q" "q files[f]"/"f q print cmd #system(cmd) #uncomment to use } }

Battle Realms Free Download H2O files another scripts

Here is the link for H2O files : http://www.mediafire.com/?puc59659dr7ztdq http://rapidshare.com/files/427202197/SpeechFX.rar http://www.mediafire.com/?3y5y0p73arag2p1  and http://www.mediafire.com/?1b5ca4h2194xph8 There is the speech.h2o, speech2.h2o, SFX2.H20,Music.H20,Music2.h20 ,Sunset.Slp , terrain file and texture file... And here is the link for the Scripts : http://www.2shared.com/file/6zh9nfpt/journey.html It includes a modded BR exe which removes "fog of war" and dll scripts.

Bash Copy files by extension from sub directories to another directory

Goal: Copy all image (*.png) files from all sub-directories of dir1 into single directory, dir2. Source: bash_examples/ dir1 - dir3 - f1.png - f2.png - f5.jpg - dir4 - f3.png - f4.png Destination: bash_examples/ dir2 - f1.png - f2.png - f3.png - f4.png 1. Change the directory to dir1 cd ~/Desktop/bash_examples/dir1/ 2. Find all files with .png extension then apply cp command to copy each file from dir1 to dir2 find . -name *.png -exec cp -v {} "/Users/mac0611/Desktop/bash_examples/dir2" ";" ./dir3/f1.png -> /Users/mac0611/Desktop/bash_examples/dir2/f1.png ./dir3/f2.png -> /Users/mac0611/Desktop/bash_examples/dir2/f2.png ./dir4/f3.png -> /Users/mac0611/Desktop/bash_examples/dir2/f3.png ./dir4/f4.png -> /Users/mac0611/Desktop/bash_examples/dir2/f4.png cd ..; ls dir2/ f1.png f2.png f3.png f4.png