TUTORIAL IPFS - retrieving pins' hash and batch importing
Let's say that you have some pinned files on your IPFS node but also no idea of their hash.
You can retrieve the list of files by executing this simple command:
ipfs pin ls
but far too many hashes will be printed out!
at this point you start saying yourself something like: "there must be a better way!" and indeed there is:
ipfs pin ls --t=recursive
okay, now you want to send all these hashes to someone, save them on your hashbook, send them to someone... but all these lines have a part that is, well repetitive! So you want to cut that "recursive" text out! So, supposing you are on Linux like me and you are using bash, this will serve you well!
ipfs pin ls --t=recursive | sed 's/ recursive//'
and this will save the output to an easily shareable file:
ipfs pin ls --t=recursive | sed 's/ recursive//' > my_pins_collection.txt
perfect! But let's say that you have thousands of pins! having this file you surely can run ipfs pin add {{hash}} but it will take you, well... too much, better spendable, time! so here this while loop will help you to pin all the files on the file you just created:
while read hashline; do
ipfs pin add "$hashline";
done < my_pins_collection.txt
and that's all!
Now your pins are importing on your friend's computer, on your backup server, on your colleague's work folder... anyway it is destinated!
HAPPY SHARING! ;D
donation area: http://fgobbo.com/donate (it helps me to keep servers running ipfs nodes)
Leave TUTORIAL IPFS - retrieving pins' hash and batch importing to:
Read more #ipfs posts
Best Posts From FraYoshi Gobbo
We have not curated any of frayoshi's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From FraYoshi Gobbo
- Valentine's day - short film about bullism (subtitled) - High School Giobert, Asti
- 「Linux」 how to type japanese or non latin like chinese or korean
- 「Linux」come digitare in lingue non latine come giapponese, cinese o coreano
- How to play flash video on Linux (pepperflash)
- CAT vs MAN! Let's Dance! [vEmoLink]
- Virtual Scacchi - SPOT 15"
- 【LINUX】 Type in japanese using fcitx and mozc 「HOW TO」
- 「 Speed Modelling 」 Duckling adrift in the ocean live modeled in blender 3D
- 「 Speed Modelling 」 Heart on blender 3D
- 「 Speed Modelling 」 Xmas hat - merry xmas on Blender