MSGS(1)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.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 of msgs; the next time msgs will pick up where it last left off. self-care, honestly.
  • -s β€” append the current message to the file Messages in the current directory; s- will save the previously displayed message. a s or s- may be followed by a space and a file name to receive the message, replacing the default Messages. (yes she's flexible, we stan πŸ’–)
  • -m β€” a copy of the specified message is placed in a temporary mailbox and mail(1) is invoked on that mailbox. both m and s accept 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 of bounds is incorrect it can be fixed by removing it; msgs will make a new bounds file the next time it is run with the -s option. BUT if msgs is run with any option other than -s, an error will be displayed if /var/msgs/bounds does 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 say No new messages.. this is useful in a .login file since this is often the case here. silence is golden ✨
  • -q β€” queries whether there are messages, printing There are new messages. if there are. the command msgs -q is 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, causing msgs to start at the specified message rather than at the next message indicated by your .msgsrc file. 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 .msgsrc file, useful for reviews of recent messages. time travel but make it mail ⭐
  • -p β€” pipe long messages through less(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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms