Commands using mailq (2)


  • 0
    mailq | grep DrWEB | awk {'print $1'} | sed s/*//g | postsuper -d -
    foob4r · 2009-08-21 22:01:41 3
  • Used it on daily basis, not sure if it's any better than the OPs version, tho' One advantage is - you can replace 'bash' at the end of the line with eg. cat - to check if the generated command is OK. Show Sample Output


    -1
    mailq |awk '/MAILER-DAEMON/{gsub("*","");printf("postsuper -d %s\n",$1)}'|bash
    unefunge · 2010-11-24 11:42:54 20

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands


Check These Out

Fibonacci numbers with awk
recursive version, "pure" AWK

Use nroff to view the man pages
Using nroff , it is possible to view the otherwise garbled man page with col command.

Get creation date of a file on ext2-3-4 fs
Return the creation date of a file on ext2, 3, 4 filesystems, because stat command won't show it. Useful on ubuntu, debian, and else

Stripping ^M at end of each line for files
just deletes to rogue CR from dos files, and tr is always available.

Search through files, ignoring .svn

list block devices
Shows all block devices in a tree with descruptions of what they are.

Add a Clock to Your CLI

Temporarily suspend and unsuspend a foreground job
Press ^Z, do what you need to do on the shell, then input % to resurrect the suspended job.

Color STDERR in output
This command will take the output of a command and color any STDERR output as a different color (red outline in this case)

Find the package that installed a command


Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: