Quantcast
Channel: Commands using split
Browsing latest articles
Browse All 16 View Live

Image may be NSFW.
Clik here to view.

Split and join with split and cat.

$ split -b 1k file ; cat x* > file `split -b 1k file` splits files into 1k chunks. Rejoin them with `cat x* > file`. View this command to comment, vote or add to favourites View all commands by...

View Article



Image may be NSFW.
Clik here to view.

Split File in parts

$ split -b 19m file Nameforpart Split File in 19 MB big parts, putting parts together again via cat Nameforpartaa Nameforpartab Nameforpartac >> File View this command to comment, vote or add to...

View Article

Image may be NSFW.
Clik here to view.

split source code to page with numbers

$ pr -l 40 bitree.c > printcode; split -40 printcode -d page_ View this command to comment, vote or add to favourites View all commands by franzcai Diff your entire server config at ScriptRock.com

View Article

Image may be NSFW.
Clik here to view.

Create a Multi-Part Archive Without Proprietary Junkware

$ tar czv Pictures | split -d -a 3 -b 16M - pics.tar.gz. Leave it to a proprietary software vendor to turn a cheap and easy parlor trick into a selling point. "Hey guys, why don't we turn our...

View Article

Image may be NSFW.
Clik here to view.

Do quick arithmetic on numbers from STDIN with any formatting using a perl...

$ perl -ne '$sum += $_ for grep { /\d+/ } split /[^\d\-\.]+/; print "$sum\n"' Good for summing the numbers embedded in text - a food journal entry for example with calories listed per food where you...

View Article


Image may be NSFW.
Clik here to view.

Split a tarball into multiple parts

$ tar cf - <dir>|split -b<max_size>M - <name>.tar. Create a tar file in multiple parts if it's to large for a single disk, your filesystem, etc. Rejoin later with `cat .tar.*|tar xf...

View Article

Image may be NSFW.
Clik here to view.

Sort a character string

$ echo sortmeplease | perl -pe 'chomp; $_ = join "", sort split //' using perl View this command to comment, vote or add to favourites View all commands by sharfah Diff your entire server config at...

View Article

Image may be NSFW.
Clik here to view.

Split huge file into DVD+R size chunks for burning

$ split -b 4700000000 file.img.gz file.img.gz. Real DVD+R size is 4700372992 bytes, but I round down a little to be safe. To reconstitute use cat. "cat file.img.gz.aa file.img.gz.ab ..... >...

View Article


Image may be NSFW.
Clik here to view.

Split a file into equal size chunks and archive to (e)mail account.

$ split -b4m file.tgz file.tgz. ; for i in file.tgz.*; do SUBJ="Backup Archive"; MSG="Archive File Attached"; echo $MSG | mutt -a $i -s $SUBJ YourEmail@(E)mail.com This is just a little snippit to...

View Article


Image may be NSFW.
Clik here to view.

convert ascii string to hex

$ echo $ascii | perl -ne 'printf "%x", ord for split //' just a bit simpler View this command to comment, vote or add to favourites View all commands by linuxrawkstar Diff your entire server config at...

View Article

Image may be NSFW.
Clik here to view.

Find default gateway (proper at ppp connections too)

$ route -n | perl -ne '$ANY="0.0.0.0"; /^$ANY/ and split /\s+/ and print "Gateway to the World: ",($_[1]!=$ANY)?$_[1]:(`ip address show $_[$#_]`=~/peer ([0-9\.]+)/ and $1),", via $_[$#_].\n"' View this...

View Article

Image may be NSFW.
Clik here to view.

encrypt, split and get ready for dvd a large file via tar and ccrypt

$ tar czf - /directory/to/tar | ccrypt -k yourpassword | split -b50m - /final/encrypted.cpt View this command to comment, vote or add to favourites View all commands by symgryph Diff your entire server...

View Article

Image may be NSFW.
Clik here to view.

Split SQL/TXT File into 12000 Lines Each File and then Add .sql Extension to...

$ split -l 12000 -a 5 database.sql splited_file i=1 for file in splited_file* do mv $file database_${i}.sql i=$(( i + 1 )) done For some reason split will not let you add extension to the files you...

View Article


Image may be NSFW.
Clik here to view.

Create a bunch of dummy text files

$ base64 /dev/urandom | head -c 33554432 | split -b 8192 -da 4 - dummy. Avoiding a for loop brought this time down to less than 3 seconds on my old machine. And just to be clear, 33554432 = 8192 *...

View Article

Image may be NSFW.
Clik here to view.

Split up SQL dump by table

$ split -p 'DROP TABLE IF EXISTS' dump.sql dump.sql- View this command to comment, vote or add to favourites View all commands by ZoeB Diff your entire server config at ScriptRock.com

View Article


Image may be NSFW.
Clik here to view.

split & combine a large file

$ split -b 500m file.gz file.gz.part- To recombine split files: cat file.gz.part* > file.gz View this command to comment, vote or add to favourites View all commands by mayurpant Diff your entire...

View Article
Browsing latest articles
Browse All 16 View Live




Latest Images