Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

Linux 安裝 mail 指令:解決「command not found」問題

編輯:Linux 教學

問題背景

最小化安裝的 Linux 系統常缺少常用指令(如 mail),執行時提示 command not found。

解決步驟

1. 搜尋套件名稱

yum search mail

輸出關鍵行:

mailx.i386 : The /bin/mail program for sending e-mail messages.

2. 安裝對應套件

yum install -y mailx

安裝完成後即可使用 mail 指令寄送郵件。

補充說明

  • mailx 是標準 mail 指令的增強版實作,提供 /bin/mail 連結。
  • Debian/Ubuntu 系統請用 apt install mailutils 或 bsd-mailx。
  • 若需 SMTP 發信功能,諈確認 /etc/mail.rc 或 ~/.mailrc 設定 set smtp=smtp://server:port。
Copyright © Windows教程網 All Rights Reserved