MSGS(1)
π MSGS(1) β the system messages & junk mail program, explained
okay bestie, so msgs is this manual page from the General Commands Manual and honestly it's giving "retro terminal energy" and i'm obsessed π
. here's the whole thing, no gatekeeping, nothing skipped, fr fr.
β¨ SYNOPSIS β¨
msgs [-fhlpq] [number] [-number]
msgs [-s]
msgs [-c] [-days]
that's the whole vibe check at the top. three whole shapes, pick your fighter π«Ά
πΈ DESCRIPTION πΈ
so the msgs utility is literally there to read system messages π. these messages get sent by mailing to the login msgs β and they should be short lil pieces of info that are suitable to be read once by most users of the system. like a story that self-deletes, kinda iconic.
normally you invoke msgs every single time you log in, by putting it in the file .login (or .profile if you're an sh(1) girlie π). it'll then prompt you with the source and subject of each new message. if there's no subject line, the first few non-blank lines of the message get displayed instead. and if there's more to the message, you'll be told how long it is and asked whether you wish to see the rest. so polite! π
the possible responses are (icymi, these are the keys you type back to it):
-yβ type the rest of the message. go off, show me everything β¨- RETURN β synonym for
y. just hit enter, lowkey the easiest path. -nβ skip this message and go on to the next message. not me ignoring it π-β redisplay the last message. for when you forgor π-qβ drop out ofmsgs; the next timemsgswill pick up where it last left off. self-care, honestly.-sβ append the current message to the fileMessagesin the current directory;s-will save the previously displayed message. asors-may be followed by a space and a file name to receive the message, replacing the defaultMessages. (yes she's flexible, we stan π)-mβ a copy of the specified message is placed in a temporary mailbox andmail(1)is invoked on that mailbox. bothmandsaccept a numeric argument in place of the-. big main character flexibility energy π
now, the bookkeeping part β and ngl this is the part you need to know:
msgs keeps track of the next message you'll see by a number in the file .msgsrc in your home directory π . and in the directory /var/msgs it keeps a set of files whose names are the (sequential) numbers of the messages they represent. the file /var/msgs/bounds shows the low and high number of the messages in the directory, so that msgs can quickly determine if there are no messages for you. so efficient, so iconic β
π¨ okay important: if the contents ofboundsis incorrect it can be fixed by removing it;msgswill make a newboundsfile the next time it is run with the-soption. BUT ifmsgsis run with any option other than-s, an error will be displayed if/var/msgs/boundsdoes not exist. so like... don't just delete it and then run it normally, bestie π
π¦ setting up posting (the -s option)
the -s option is used for setting up the posting of messages. the line
msgs: "| /usr/bin/msgs -s"
should be included in /etc/mail/aliases (see newaliases(1)) to enable posting of messages. that's the whole setup, no cap π
π§Ή cleanup duty (the -c option)
the -c option is used for performing cleanup on /var/msgs. a shell script entry to run msgs with the -c option should be placed in /etc/periodic/daily (see periodic(8)) to run every night π. this will remove all messages over 21 days old. a different expiration may be specified on the command line to override the default. you must be the superuser to use this option π (yes, actual root privileges required, this is not a drill).
π OPTIONS π
options when reading messages include:
-fβ do not sayNo new messages.. this is useful in a.loginfile since this is often the case here. silence is golden β¨-qβ queries whether there are messages, printingThere are new messages.if there are. the commandmsgs -qis often used in login scripts. lowkey the most-used one fr fr.-hβ print the first part of messages only. a lil preview, a teaser, if you will πΈ-lβ cause only locally originated messages to be reported. keep it local, keep it cute.numβ a message number can be given on the command line, causingmsgsto start at the specified message rather than at the next message indicated by your.msgsrcfile. thus
msgs -h 1
prints the first part of all messages. look at her go π₯
-numberβ start number messages back from the one indicated in the.msgsrcfile, useful for reviews of recent messages. time travel but make it mail β-pβ pipe long messages throughless(1). your scrollback said thank u π
within msgs you can also go to any specific message by typing its number when msgs requests input as to what to do. iykyk π§
π ENVIRONMENT π
the msgs utility uses the HOME and TERM environment variables for the default home directory and terminal type. two lil env vars, doing their thing π«Ά
π FILES π
/var/msgs/*β database~/.msgsrcβ number of next message to be presented
π SEE ALSO π
less(1), mail(1), aliases(5), periodic(8)
go read those too, they're all part of the lore π
π HISTORY π
the msgs command appeared in 3.0BSD. ancient. legendary. still here. periodt πβ¨
so yeah, that's msgs(1) β Debian build, dated August 8, 2018 ποΈ β and that's the whole page, every flag and file and warning intact, bestie. now go read your system messages, they miss you ππ bye!!
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 1980, 1990, 1993 The Regents of the University of California. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms