File retrieval - File Holding

If I add a file into IPFS and retrieve it from another computer, would I then be able to retrieve the file from that second computer as well? and if so, is it encrypted?

If the the computer that you retrieved the file with is an IPFS node that’s online and you retrieved the file through IPFS, then the computer you retrieved the file should be able to provide it to subsequent computers attempting to retrieve the file.

No; not unless you encrypted the file yourself.

And how would I be able to retrieve it using IPFS? The example on the docs was with curl
Would I need to pin it in order to keep it from garbage collection or is it automatically pinned once I retrieve it?

You didn’t state how you retrieved the file, so I incorrectly assumed you retrieved it on a second node using IPFS.

Assuming you’ve added a file to IPFS on one node, you can retrieve it from any other IPFS node (assuming there’s not a connection problem between the other nodes and your node) using ipfs get <hash> or ipfs cat <hash>. Neither of these commands will result in the file being pinned on your node and may get deleted if garbage collection is run.

If you want to pin a file on your node and prevent it from being garbage collected, you’d need to use ipfs pin add <hash>.

Thank you very much.