About paste.rs
paste.rs describes itself as a simple, no-frills, command line driven pastebin. It is built with Rocket, a web framework for the Rust programming language, and its whole interface is a handful of HTTP requests: send raw data with a POST, read it with a GET, and remove it with a DELETE.
How a paste is displayed depends on the extension you add to its URL. With no extension it is returned as plain text. Adding .md, .mdown or .markdown renders it as Markdown, and adding a known code extension such as .py or .rs returns syntax highlighted HTML. A basic web form is also available at paste.rs/web for pasting from a browser.
How to create a paste
Paste a file or standard input with curl:
curl --data-binary @file.txt https://paste.rs/
echo "Hello, world." | curl --data-binary @- https://paste.rs/
The response is the URL of the new paste. A status of 201 means the whole paste was stored; 206 means it was larger than the server's maximum upload size and was truncated.
To delete a paste:
curl -X DELETE https://paste.rs/<id>
The site suggests a shell function for your .bashrc:
function paste() {
local file=${1:-/dev/stdin}
curl --data-binary @${file} https://paste.rs
}
Things to know
- Public links: anyone with a paste URL can read it, and there is no password or encryption. Do not paste secrets.
- Rate limits: the site states that pasting is heavily rate limited.
- Size: the server truncates pastes over its maximum upload size (the exact figure is not published). The web form accepts up to 393,216 characters.
- Retention: the site does not state how long pastes are kept.
Frequently asked questions
How do I paste a file to paste.rs?
Use curl: curl --data-binary @file.txt https://paste.rs/. The response is the URL of the new paste.
What happens if my paste is too large?
If the upload exceeds the server's maximum size, paste.rs stores only part of it and returns a 206 (Partial Content) status instead of 201 (Created).
How do I delete a paste?
Send a DELETE request to the paste URL, for example: curl -X DELETE https://paste.rs/<id>.