How do I delete everything in /var/mail/username from the command line?

G__

As a result of a long-running cron job, I have over 1,000 messages in my user's mailbox. What's the easiest way to delete them?

James Henstridge

If you want to delete all the messages, you can simply truncate the mailbox file for a user with the following command:

> /var/mail/username

(the greater than sign is not a prompt: you are in effect redirecting the output of nothing to the file, which will truncate it).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How do I delete everything after second occurrence of quotes using the command line?

From Dev

How can I delete everything until a pattern and everything after another pattern from a line?

From Dev

How do I extract everything from the start of a line to a specific string?

From Dev

How do I delete all empty directories in a directory from the command line?

From Java

How do I delete everything in Redis?

From Dev

How can I delete everything after a word from multiple line in a file

From Dev

How do I execute a command in an iTerm window from the command line?

From Dev

How do I pass a username to an FTP command from the command line?

From Dev

Have Windows (or PowerShell) Log Everything I do in a Command Line?

From Dev

How can I ask icinga2 from the command line to execute a single-time check of everything?

From Dev

How do I detach from a controlling terminal from the command line?

From Dev

How do I add / delete a line from a text file?

From Dev

How do I SELECT data from a MySQL table and DELETE everything else?

From Java

How do I drop a MongoDB database from the command line?

From Java

How do I launch the Android emulator from the command line?

From Dev

How do I run a gui app from the command line?

From Dev

How do I read arguments from the command line with an MPI program?

From Dev

How do I open a file with Chrome from the command line?

From Dev

How do I get the default font from the command line?

From Dev

How do I upgrade releases from a Live USB with the command line?

From Dev

How do I install the latest version of cmake from the command line?

From Dev

How do I start the Privacy and Activity Manager from command line?

From Dev

How do I make pip available from command line mac?

From Dev

How do I build boost 1.55 from the command line with mingw?

From Dev

How do I control the WMP from command line/batch

From Dev

How do I open a WinSCP GUI session from command line?

From Dev

How do I add multiple "+" commands into less from the command line

From Dev

How do I download mail folders from command line?

From Dev

How do I install Chromium from the command line?

Related Related

  1. 1

    How do I delete everything after second occurrence of quotes using the command line?

  2. 2

    How can I delete everything until a pattern and everything after another pattern from a line?

  3. 3

    How do I extract everything from the start of a line to a specific string?

  4. 4

    How do I delete all empty directories in a directory from the command line?

  5. 5

    How do I delete everything in Redis?

  6. 6

    How can I delete everything after a word from multiple line in a file

  7. 7

    How do I execute a command in an iTerm window from the command line?

  8. 8

    How do I pass a username to an FTP command from the command line?

  9. 9

    Have Windows (or PowerShell) Log Everything I do in a Command Line?

  10. 10

    How can I ask icinga2 from the command line to execute a single-time check of everything?

  11. 11

    How do I detach from a controlling terminal from the command line?

  12. 12

    How do I add / delete a line from a text file?

  13. 13

    How do I SELECT data from a MySQL table and DELETE everything else?

  14. 14

    How do I drop a MongoDB database from the command line?

  15. 15

    How do I launch the Android emulator from the command line?

  16. 16

    How do I run a gui app from the command line?

  17. 17

    How do I read arguments from the command line with an MPI program?

  18. 18

    How do I open a file with Chrome from the command line?

  19. 19

    How do I get the default font from the command line?

  20. 20

    How do I upgrade releases from a Live USB with the command line?

  21. 21

    How do I install the latest version of cmake from the command line?

  22. 22

    How do I start the Privacy and Activity Manager from command line?

  23. 23

    How do I make pip available from command line mac?

  24. 24

    How do I build boost 1.55 from the command line with mingw?

  25. 25

    How do I control the WMP from command line/batch

  26. 26

    How do I open a WinSCP GUI session from command line?

  27. 27

    How do I add multiple "+" commands into less from the command line

  28. 28

    How do I download mail folders from command line?

  29. 29

    How do I install Chromium from the command line?

HotTag

Archive