{"id":679,"date":"2026-05-04T19:42:02","date_gmt":"2026-05-04T18:42:02","guid":{"rendered":"https:\/\/www.fukr.org.uk\/?p=679"},"modified":"2026-05-04T19:44:22","modified_gmt":"2026-05-04T18:44:22","slug":"mail-cheat-sheet","status":"publish","type":"post","link":"https:\/\/www.fukr.org.uk\/?p=679","title":{"rendered":"mail\u00a0Cheat Sheet"},"content":{"rendered":"\n<p>The\u00a0<strong>UNIX mail command<\/strong>\u00a0is\u00a0a fundamental utility on Unix-like operating systems used to\u00a0<strong>send and receive electronic mail<\/strong>\u00a0directly from the command line.\u00a0<br><br>\u00a0It functions as a Mail User Agent (MUA) that allows users to manage their mailbox, compose messages, and interact with recipients without a graphical interface.\u00a0<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"start-exit\">Start \/ Exit<\/h2>\n\n\n\n<p><code>mail<\/code>&nbsp;open mailbox<br><code>q<\/code>&nbsp;quit and SAVE changes<br><code>x<\/code>&nbsp;exit WITHOUT saving<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"reading-mail\">Reading Mail<\/h2>\n\n\n\n<p><code>Enter<\/code>&nbsp;next message<br><code>p<\/code>&nbsp;print current message<br><code>n<\/code>&nbsp;next message<br><code>5<\/code>&nbsp;jump to message 5<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"deleting-mail\">Deleting Mail<\/h2>\n\n\n\n<p><code>d 1 2 3<\/code>&nbsp;delete specific messages<br><code>d 1-10<\/code>&nbsp;delete range<br><code>d *<\/code>&nbsp;delete ALL messages<br><code>d .<\/code>&nbsp;delete current message<br><code>d .-5<\/code>&nbsp;current + previous 5<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"search-and-delete\">Search and Delete<\/h2>\n\n\n\n<p><code>\/word<\/code>&nbsp;search messages<br><code>d \/word<\/code>&nbsp;delete matches<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"examples\">Examples:<\/h3>\n\n\n\n<p><code>d \/cron<\/code><br><code>d \/root<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"smart-selectors\">Smart Selectors<\/h2>\n\n\n\n<p><code>d :r<\/code>&nbsp;delete all read<br><code>d :n<\/code>&nbsp;delete all new<br><code>d :u<\/code>&nbsp;delete all unread<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"message-management\">Message Management<\/h2>\n\n\n\n<p><code>h<\/code>&nbsp;show headers<br><code>z<\/code>&nbsp;next page<br><code>z-<\/code>&nbsp;previous page<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"sending-replying\">Sending \/ Replying<\/h2>\n\n\n\n<p><code>r<\/code>&nbsp;reply<br><code>R<\/code>&nbsp;reply to all<br><code>m user<\/code>&nbsp;send mail<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"saving-messages\">Saving Messages<\/h2>\n\n\n\n<p><code>s 5 file<\/code>&nbsp;save message 5<br><code>s 1-10 mbox<\/code>&nbsp;save multiple<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"undelete-before-quitting\">Undelete (before quitting)<\/h2>\n\n\n\n<p><code>u 3<\/code>&nbsp;undelete message 3<br><code>u 1-5<\/code>&nbsp;undelete range<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"quick-workflows\">Quick Workflows<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"delete-first-50-read-mail\">Delete first 50 + read mail:<\/h3>\n\n\n\n<p><code>mail<\/code><br><code>d 1-50<\/code><br><code>d :r<\/code><br><code>q<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"delete-everything\">Delete everything:<\/h3>\n\n\n\n<p><code>mail<\/code><br><code>d *<\/code><br><code>q<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"delete-by-keyword\">Delete by keyword:<\/h3>\n\n\n\n<p><code>mail<\/code><br><code>d \/spam<\/code><br><code>q<\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"notes\">Notes<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Changes only apply after&nbsp;<code>q<\/code><\/li>\n\n\n\n<li>Use&nbsp;<code>x<\/code>&nbsp;to cancel all changes<\/li>\n\n\n\n<li>You can combine multiple delete commands before quitting<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The\u00a0UNIX mail command\u00a0is\u00a0a fundamental utility on Unix-like operating systems used to\u00a0send and receive electronic mail\u00a0directly from the command line.\u00a0 \u00a0It functions as a Mail User Agent (MUA) that allows users to manage their mailbox, compose messages, and interact with recipients without a graphical interface.\u00a0 Start \/ Exit mail&nbsp;open mailboxq&nbsp;quit and SAVE changesx&nbsp;exit WITHOUT saving Reading [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,7],"tags":[],"class_list":["post-679","post","type-post","status-publish","format-standard","hentry","category-netbsd","category-smartos"],"_links":{"self":[{"href":"https:\/\/www.fukr.org.uk\/index.php?rest_route=\/wp\/v2\/posts\/679","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fukr.org.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fukr.org.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fukr.org.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fukr.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=679"}],"version-history":[{"count":2,"href":"https:\/\/www.fukr.org.uk\/index.php?rest_route=\/wp\/v2\/posts\/679\/revisions"}],"predecessor-version":[{"id":681,"href":"https:\/\/www.fukr.org.uk\/index.php?rest_route=\/wp\/v2\/posts\/679\/revisions\/681"}],"wp:attachment":[{"href":"https:\/\/www.fukr.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=679"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fukr.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=679"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fukr.org.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=679"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}