MEWBIES@: Facebook Twitter G+ YouTube DeviantArt Forum Wall
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██ ██
█▌ - COMPRESS (PACK), EXTRACT (UNPACK), SFV, CONVERT ISO-BIN - █▌
█▌ █▌
█ ▐▌
█ This tutorial is for Linux command line only. It covers how to: ▐▌
█ INSTALL VARIOUS TYPES NEEDED ▐▌
█ ▐▌
█ ZIP ▐▌
█ UNZIP ▐▌
█ RAR ▐▌
█ UNRAR ▐▌
█ TAR.BZ2 & BZ2 ▐▌
█ GZ ▐▌
█ TGZ & TAR.GZ ▐▌
█ ▐▌
█ CREATE A SFV OR CSV FILE ▐▌
█ SPLIT A ZIP INTO MULTIPLE ZIPS ▐▌
█ LIST AND EXTRACT FILES FROM AN ISO ▐▌
█ CONVERT A DAA OR AN ISO TO A BIN ▐▌
█ HOW TO VERIFY A CHECKSUM MD5 SHA1 SHA224 SHA256 SHA384 SHA512 ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ For the examples I'll use existing files on my server and list the cmds ▐▌
█ that I use often. Just change the file names and the paths to your own. ▐▌
█ If any of your file names have spaces you'll need to use " before and ▐▌
█ after the file name, e.g. "I have spaces.zip" ▐▌
█ ▐▌
█ PREREQUISITES: ▐▌
█ `````````````` ▐▌
█ Skip those that you don't need, cmds are in bold: ▐▌
█ su ▐▌
█ apt-get install zip rar unrar ▐▌
█ ▐▌
█ For SFV, a sfv checker and generator: ▐▌
█ apt-get install cksfv ▐▌
█ Or CFV a versatile file checksum creator, sfv or csv, and verifier: ▐▌
█ apt-get install cfv ▐▌
█ For CFV these are required: ▐▌
█ apt-get install python-dev python-imaging debhelper ▐▌
█ exit ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ ZIP: ▐▌
█ ```` ▐▌
█ For a complete list of options: ▐▌
█ zip -h ▐▌
█ You can find other examples HERE or HERE. ▐▌
█ I have eggdrop1.6.19.tar.gz in my current directory. I want to zip that up ▐▌
█ with best compression '-9' (-0 being none): ▐▌
█ zip eggdrop -9 eggdrop1.6.19.tar.gz ▐▌
█ That created eggdrop.zip, contents of the zip are eggdrop1.6.19.tar.gz ▐▌
█ ▐▌
█ OK now lets create a test directory and copy a file into it to test ▐▌
█ zipping up a directory and all of its contents: ▐▌
█ mkdir testzip ▐▌
█ cp eggdrop1.6.19.tar.gz /testzip/eggdrop1.6.19.tar.gz ▐▌
█ zip eggdrop2 -9 testzip/* ▐▌
█ That created eggdrop2.zip, containg testzip/eggdrop1.6.19.tar.gz ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ UNZIP: ▐▌
█ `````` ▐▌
█ For a complete list of options: ▐▌
█ unzip -h ▐▌
█ You can find other examples HERE. ▐▌
█ unzip mewbies1.zip ▐▌
█ That will unzip the file to current directory. ▐▌
█ If you repeat the same cmd again, file already exist, you'll receive a ▐▌
█ list of options. ▐▌
█ Other examples: ▐▌
█ unzip -l mewbies1.zip (this will list files inside ▐▌
█ unzip -j mewbies1.zip (this will test archive & list files ▐▌
█ unzip -tq \*.zip (to test all files in dir and list summary ▐▌
█ unzip mewbies1.zip -d ~/tmp/test (extracts and makes directory if it ▐▌
█ doesn't exist. Note you must state full path to extract to. ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ RAR: ▐▌
█ ```` ▐▌
█ For a complete list of options: ▐▌
█ rar -h ▐▌
█ For this example I have a large movie of my cats on the server and I want ▐▌
█ to pack that in manageable sizes, 15MB, for doggie to download and of ▐▌
█ course with the best compression (-m5 best, -m0 none, -m3 is default): ▐▌
█ rar a -m5 -v15000000kb -vn mewbies1 Cats_home_move.avi ▐▌
█ (compression will be m5g and this created mewbies1.rar, mewbies1.r00, ▐▌
█ mewbies1.r01, and mewbies1.r02) ▐▌
█ ▐▌
█ OTHER PACKING EXAMPLES: ▐▌
█ If you were to do the above cmd like this: ▐▌
█ rar a -m5 -v15m mewbies1 Cats_home_move.avi ▐▌
█ You will end up with file sizes being 15,728,640 and the file names ugly: ▐▌
█ mewbies.part1.rar, mewbies.part2.rar, etc. (-vn switch prevents this). ▐▌
█ ▐▌
█ Pack Cats_home_move.avi into one large -m3 file named mewbies1.rar: ▐▌
█ rar a mewbies1.rar Cats_home_move.avi ▐▌
█ ▐▌
█ OTHER CMDS: ▐▌
█ rar t mewbies1.rar (test integrity and list out archive content ▐▌
█ rar v mewbies1.rar (test compression and list out archive content ▐▌
█ rar vb mewbies1.rar (list contents basic mode ▐▌
█ rar vt mewbies1.rar (also list compression, little shorter list ▐▌
█ rar vt mewbies1.rar >techlist.lst (list contents (technical mode) and ▐▌
█ redirect output to file techlist.lst ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ UNRAR - EXTRACT / UNPACK RAR FILES: ▐▌
█ ``````````````````````````````````` ▐▌
█ For a complete list of options: ▐▌
█ unrar -h ▐▌
█ You can find other examples HERE. ▐▌
█ rar e mewbies1.rar (this will extract the files from the rar set ▐▌
█ rar x mewbies1.rar (this will extract the files with full path ▐▌
█ unrar x mewbies1.rar Cats/ (extracts to a directory Cats and ▐▌
█ creates it if it doesn't exist ▐▌
█ ▐▌
█ OTHER CMDS: ▐▌
█ unrar lt mewbies1.rar (test compression and list out archive content ▐▌
█ unrar lb mewbies1.rar (list contents basic mode ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ TAR.BZ2 & BZ2 EXTENSIONS: ▐▌
█ ````````````````````````` ▐▌
█ If you have a file with the extension '.tar.bz2' for example mew.tar.bz2 ▐▌
█ to decompress (unpack) this: ▐▌
█ tar xjvf cornbread.tar.bz2 ▐▌
█ If the file is only .bz2 for example mew.bz2 then: ▐▌
█ bunzip2 mew.bz2 ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ GZ EXTENSION (next section .tar.gz extension): ▐▌
█ `````````````````````````````````````````````` ▐▌
█ .gz .tgz tar.gz EXTENSIONS: ▐▌
█ If the file's extension is only .gz, for example mew.pl.gz to decompress: ▐▌
█ gunzip mew.pl.gz ▐▌
█ or ▐▌
█ gzip -d mew.pl.gz ▐▌
█ ▐▌
█ NOTE: After decompressing a file gunzip / gzip will delete the *.gz ▐▌
█ To decompress and not delete the .gz file: ▐▌
█ gzip -dc mew.pl.gz ▐▌
█ And to decompress and rename mew.pl to mew1.pl: ▐▌
█ gzip -dc mew.pl.gz > mew1.pl ▐▌
█ ▐▌
█ NOTE: ▐▌
█ If you have a file named 'mew.pl' and use gunzip to pack it, it will be ▐▌
█ packed as 'mew.pl.gz'. Some websites don't allow or repsond well to this ▐▌
█ type of file naming '.pl.gz'. You could rename the file to mewpl.gz so ▐▌
█ users are able to download it but when it is decompressed the file ▐▌
█ enclosed (mew.pl) will be extracted as 'mewpl' if it wasn't in a directory.▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ TGZ & TAR.GZ EXTENSIONS: ▐▌
█ ```````````````````````` ▐▌
█ x extract ▐▌
█ v verbose ▐▌
█ f file name ▐▌
█ z compress using gzip (.gz) ▐▌
█ c create archive name ▐▌
█ ▐▌
█ EXTRACT FILES: ▐▌
█ gunzip < myname.tar.gz | tar xvf - ▐▌
█ gunzip < myname.tgz | tar xvf - ▐▌
█ ▐▌
█ OR: ▐▌
█ tar xvzf name.tar.gz ▐▌
█ tar xvzf name.tgz ▐▌
█ ▐▌
█ COMPRESS FILE: tar zvfc myname.tar.gz myfile ▐▌
█ COMPRESS DIRECTORY; 'dir3': tar zvfc myname.tar.gz dir3 ▐▌
█ This resulting tar.gz will be in your working directory. ▐▌
█ ▐▌
█ You can state a directory that isn't in the location you are, for example: ▐▌
█ tar zvfc name.tar.gz ~/dir1/dir2/dir3 ▐▌
█ Extracting the resulting .tar.gz file though will result in: ▐▌
█ /home/username/dir1/dir2/dir3/ all your files ▐▌
█ Only dir3 will contain files. ▐▌
█ So if you want to compress a single directory, and extraction only ▐▌
█ contains that single directory (without the entire path) then be in the ▐▌
█ root of that directory, for example: ▐▌
█ cd ~/dir1/dir2/ then compress dir3. ▐▌
█ ▐▌
█ COMPRESS WITH MAXIMUM (9) COMPRESSION: ▐▌
█ tar cvf - dir3 | gzip -9 - > myname.tar.gz ▐▌
█ My findings thus far using maximum compression is it doesn't make that ▐▌
█ much of a difference than just using 'tar xvfz'. ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ CFV: ▐▌
█ ```` ▐▌
█ For a complete list of options: ▐▌
█ cfv -h ▐▌
█ You can find other examples HERE. ▐▌
█ Lets create an .sfv file for the mewbies1.rar set. I'll use * (wildcard) ▐▌
█ so it creates the sfv for the entire set of rars: ▐▌
█ cfv -C -f mewbies1.sfv *.r* ▐▌
█ This created mewbies1.sfv for any files in that directory that their file ▐▌
█ extension begins with a 'r'. ▐▌
█ ▐▌
█ To create a .sfv for mewbies1.rar only, not the set ▐▌
█ cfv -C -mewbies1.rar.sfv mewbies1.rar ▐▌
█ ▐▌
█ To create an .csv instead : ▐▌
█ cfv -C -f mewbies1.csv *.r* ▐▌
█ ▐▌
█ To create a .csv file for all the files in the current dir ▐▌
█ cfv -C -tcsv ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ ZIPSPLIT: ▐▌
█ ````````` ▐▌
█ This will only split an existing zip file into smaller multiple zip files. ▐▌
█ For a complete list of options: ▐▌
█ zipsplit -h ▐▌
█ zipsplit [-hiLpst] [-n size] [-b path] zipfile ▐▌
█ ▐▌
█ EXAMPLES: ▐▌
█ To first know how many zip files it will create if you split a large zip ▐▌
█ into 2MB, (default = 36000). ▐▌
█ zipsplit -tn 2000000 mewbies1.zip ▐▌
█ Create the files, split: ▐▌
█ zipsplit -n 2000000 mewbies1.zip ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ POWERISO: ▐▌
█ ````````` ▐▌
█ Extract, list, and convert image files (including ISO, BIN, DAA, and other ▐▌
█ formats). Check their site for latest versions HERE. ▐▌
█ ▐▌
█ TO INSTALL: ▐▌
█ cd ~ ▐▌
█ wget http://www.poweriso.com/poweriso-1.3.tar.gz ▐▌
█ tar zxvf poweriso-1.3.tar.gz ▐▌
█ ▐▌
█ USAGE: ▐▌
█ To view its help file: ▐▌
█ ./poweriso -? ▐▌
█ ▐▌
█ TO LIST THE CONTENTS OF AN IMAGE FILE: ▐▌
█ ./poweriso list ~/backup/mewbies.iso / -r ▐▌
█ ▐▌
█ To CONVERT A 2048 ISO TO A 2352 BIN: ▐▌
█ ./poweriso convert ~/backup/mewbies.iso -o ~/backup/mewbies.bin -ot bin ▐▌
█ To convert a BIN or a DAA file to ISO just change '-ot bin' to '-ot iso' ▐▌
█ ▐▌
█ TO EXTRACT THE CONTENTS OF AN IMAGE FILE: ▐▌
█ There are a two options so that you don't get the message ▐▌
█ "poweriso "Bad parameter: extract"" or "No such file or directory": ▐▌
█ ▐▌
█ 1. Change to the directory containing the image file first: ▐▌
█ cd ~/backup ▐▌
█ Then to extract it to a directory named extracted_db for example: ▐▌
█ /home/user/./poweriso extract mewbies.iso / -od /home/user/extracted_db ▐▌
█ ▐▌
█ 2. Or you can stay in your home directory and do the same like this: ▐▌
█ ./poweriso extract ~/backup/mewbies.iso / -od ~/extracted_db ▐▌
█ ▐▌
█ NOTES: ▐▌
█ 1. If your file name has spaces in it e.g. 'Cat Home Movie.iso', then ▐▌
█ each space needs to be preceded with a \ ▐▌
█ For example: ▐▌
█ ./poweriso convert ~/Cat\ Home\ Movie.iso -o ~/Cat\ Home\ Movie.bin -ot bin▐▌
█ ▐▌
█ 2. If you have root acess and would like to have poweriso available to all ▐▌
█ users do this: ▐▌
█ su ▐▌
█ cp poweriso /bin/poweriso ▐▌
█ exit ▐▌
█ ▐▌
█ Now the cmd would be poweriso only, from any directory; not ./poweriso ▐▌
█ or /home/user/./poweriso/ ▐▌
█ Test it: ▐▌
█ poweriso -? ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ If you want to enable any of the commands above to be available to users ▐▌
█ on your glFTPD; read my tutorial HERE (how to test the integrity, ▐▌
█ compression, or contents of rar files via glFTPD) and you would use a ▐▌
█ similar method. If you can't figure out how, but want a command enabled ▐▌
█ that is listed here; post at mewbies forum and maybe someone can help work ▐▌
█ out how. ▐▌
█ ▐▌
█ ___________..___________ ▐▌
█ ▐▌
█ HOW TO VERIFY A CHECKSUM MD5 SHA1 SHA224 SHA256 SHA384 SHA512: ▐▌
█ `````````````````````````````````````````````````````````````` ▐▌
█ On my Debian these were included, I didn't need to install them. Use ▐▌
█ these commands to verify a checksum that is posted with a file to verify ▐▌
█ that the file you have downloaded has not been altered. If a file has ▐▌
█ been altered the checksum will not match what the author has posted. ▐▌
█ MD5SUM: ▐▌
█ Example: ▐▌
█ md5sum eggdrop1.6.19+ctcpfix.tar.gz ▐▌
█ Output: 004126e29420e61cbfaca89efbfb5eb4 eggdrop1.6.19+ctcpfix.tar.gz ▐▌
█ man md5sum ▐▌
█ To quit man: q ▐▌
█ ▐▌
█ SHA: ▐▌
█ To easily list the sha commands available, type into your terminal but ▐▌
█ don't press Enter: ▐▌
█ sha ▐▌
█ Press your tab key and release. My output: ▐▌
█ sha1sum sha224sum sha256sum sha384sum sha512sum shar shasum ▐▌
█ ▐▌
█ Example: ▐▌
█ sha256sum eggdrop1.6.19+ctcpfix.tar.gz ▐▌
█ Output: 71435d61389574705ec2b2eb7a0739711f41864ca59010c1f0c8fec8b136ead2 ▐▌
█ man sha ▐▌
█ To quit man: q ▐▌
█ ▐▌
█ Note: Windows I use DAMN Hash Calculator v1.5.1, GUI, portable, freeware. ▐▌
█ ▐▌
█ ▐▌
█ //---------------------------------------------------------------------- ▐▌
█ ▐▌
█ If you find mistakes, have suggestions, and or questions please post at ▐▌
█ mewbies forum HERE - thank you. ▐▌
█ ▐▌
█ Last update on 05 Jun '13 ▐▌
█ ▐▌
█▌ █▌
█▌ - mewbies.com - █▌
█▌ █▌
██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄██