Following Gmail search operators allow you to find what you're looking for quickly and accurately. They can also be used to set up filters so you can organize your inbox automatically. Some of the most useful operators are listed below.
To specify the sender
Meaning: Messages from Amy
To specify a recipient
Meaning: All messages that were sent to David (by you or someone else)
Search for words in the subject line
Meaning: Messages that have the word "dinner" in the subject
Search for messages matching term A or term B*
*OR must be in all caps
Example: from:amy OR from:david
Meaning: Messages from Amy or from David
Used to exclude messages from your search
Example: dinner -movie
Meaning: Messages that contain the word "dinner" but do not contain the word "movie"
Search for messages by label
Example: from:amy label:friends
Meaning: Messages from Amy that have the label "friends"
Example: from:david label:my-family
Meaning: Messages from David that have the label "My Family"
Search for messages with an attachment
Example: from:david has:attachment
Meaning: Messages from David that have an attachment
Search for messages on mailing lists
Meaning: Messages with the words firstname.lastname@example.org in the headers, sent to or from this list
Search for an attachment by name or type
Meaning: Messages with an attachment named "physicshomework.txt"
Example: label:work filename:pdf
Meaning: Messages labeled "work" that also have a PDF file as an attachment
Used to search for an exact phrase*
*Capitalization isn't taken into consideration
Example: "i'm feeling lucky"
Meaning: Messages containing the phrase "i'm feeling lucky" or "I'm feeling lucky"
Example: subject:"dinner and a movie"
Meaning: Messages containing the phrase "dinner and a movie" in the subject
To group words
To specify terms that shouldn't be excluded
Example: from:amy (dinner OR movie)
Meaning: Messages from Amy that contain either the word "dinner" or the word "movie"
Example: subject:(dinner movie)
Meaning: Messages in which the subject contains both the word "dinner" and the word "movie"
Search for messages anywhere in Gmail*
*Messages in Spam and Trashare excluded from searches by default
Example: in:anywhere movie
Meaning: Messages in All Mail, Spam, andTrash that contain the word "movie"
in:inbox in:trash in:spam
Search for messages in Inbox,Trash, or Spam
Example: in:trash from:amy
Meaning: Messages from Amy that are inTrash
Example: has:purple-star from:David
Meaning: Messages from David that are marked with a purple star
Used to specify recipients in thecc: or bcc: fields*
*Search on bcc: cannot retrieve messages on which you were blind carbon copied
Meaning: Messages that were cc-ed to David
after: before: older: newer:
Search for messages sent or received during a certain period of time
(using the date format yyyy/mm/dd)
Example: after:2004/04/16 before:2004/04/18
Meaning: Messages sent between April 16, 2004 and April 18, 2004.*
*More precisely: Messages sent after 12:00 AM (or 00:00) April 16, 2004 and before April 18, 2004.
Similar to older and newer, but allows relative dates using d, m, and y for day, month, and year
Meaning: Finds messages sent within the last two days.
Search for chat messages
Example: is:chat monkey
Meaning: Any chat message including the word "monkey."
Search for messages within a particular email address in the Delivered-To line of the message header
Meaning: Any message with email@example.com in the Delivered-To: field of the message header (which can help you find messages forwarded from another account or ones sent to an alias).
Search for messages that were sent from someone who you added to a particular Google+ circle
Meaning: Any message that was sent by a person in your "Friends" circle.
Examples: circle:"soccer friends (team blue)" or circle:"my \"fab four\""
Notes: For circle names that include a space, parentheses, curly brackets, or vertical bar, add quotes around the name. For names that include quotes, add a back slash immediately before the quotes.
Search for all messages that were sent from someone who you added to your Google+ circles
Meaning: Any message that was sent by a person in any of your circles.
Search for messages within a category
Meaning: All messages in the Updates category.
Example: category:social Mindy
Meaning: Messages in the Social category that include “Mindy.”
Search for messages larger than the specified size in bytes
Meaning: All messages larger than 1MB (1,000,000 bytes) in size.
Similar to size: but allows abbreviations for numbers
Meaning: All messages of at least 10M bytes (10,000,000 bytes) in size.
Match the search term exactly
Meaning: Finds messages containing “unicorn” but not “unicorns” or “unciorn”
Find a message by the message-id header
Meaning: Locates the exact message with the specified SMTP message-id. Learn more about headers.
Search for messages that have and have not had labels that you created applied to them.
NOTE: Gmail applies labels to individual messages, not to conversation threads.
Meaning: Finds all messages without any of your own labels (excludes automatic labels like inbox, spam, and trash). Since Gmail applies labels to individual messages, you might see results that appear to have labels; in this case, another message in the same conversation thread has had a label applied to it.