LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-30-2016, 11:39 PM   #1
Johno13
LQ Newbie
 
Registered: Dec 2016
Location: Houston
Posts: 3

Rep: Reputation: Disabled
Help with Find Commands


I am currently starting out at learning all about Linux and am facing some challenges with some of the work I am required to learn. How would one use the find command to locate emails I sent from a .mail directory and the ones that I received?
 
Old 12-30-2016, 11:53 PM   #2
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 633

Rep: Reputation: 316Reputation: 316Reputation: 316Reputation: 316
What have you tried so far?
The find command can locate files. So describe some examples of:
  • emails I sent from a .mail directory
  • emails I received from a .mail directory

Otherwise we're just guessing..

Alternatively, if you want to search inside of files, you might want to use grep
 
Old 12-31-2016, 12:12 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,059

Rep: Reputation: 3671Reputation: 3671Reputation: 3671Reputation: 3671Reputation: 3671Reputation: 3671Reputation: 3671Reputation: 3671Reputation: 3671Reputation: 3671Reputation: 3671
And "find" isn't the simplest command to start off with. Likewise its manpage.

So many options make it very difficult to comprehend.
 
Old 12-31-2016, 12:42 AM   #4
Johno13
LQ Newbie
 
Registered: Dec 2016
Location: Houston
Posts: 3

Original Poster
Rep: Reputation: Disabled
My assignment was to create 3 email accounts in a cpanel and then update a rule to use in spam assassin. I was then prompted to send out 3 emails through the command line to a certain email address. The next thing they want me to do specifically is this:
Using find, locate the emails that you sent from the ./mail directory on your account. 

Using find, locate the emails that you received. 


I am not real familiar with find and just started to learn find and grep just this week so I was just looking for some advice on where to even start with find command. Sorry I am very much a noob and eager to learn.
 
Old 12-31-2016, 12:43 AM   #5
Johno13
LQ Newbie
 
Registered: Dec 2016
Location: Houston
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
And "find" isn't the simplest command to start off with. Likewise its manpage.

So many options make it very difficult to comprehend.
This a test account that I am working on at the moment designed to educate us.
 
Old 12-31-2016, 01:12 AM   #6
linux4evr5581
Member
 
Registered: Sep 2016
Location: USA
Posts: 275

Rep: Reputation: Disabled
-- To search for lost files type:
find / -name nameoflostfile -print (this will start seaching from root which may take awhile, or you can just type a specific directory path instead of the root) To search for lost files in the current directory type find . -name nameoflostfile -print

-- To seach for files you forgot the full name of type:
find pathofdirectory -name 'partofFilename*' -print (this will seach that part of the name from whatever directory path you specified) also if you want you can search mutiple directory paths, just add it with a space..

-- To search for files with variables of time type:
find pathofdirectory -mtime -3 -print (this will search for all files modified in the last 3 days) or use -mmin for minutes

Look through the man pages for more options, theres alot of useful ones...

Last edited by linux4evr5581; 12-31-2016 at 03:32 AM.
 
Old 12-31-2016, 05:14 AM   #7
Jjanel
Member
 
Registered: Jun 2016
Distribution: any&all, in VBox; Ol'UnixCLI; NO GUI resources
Posts: 999
Blog Entries: 12

Rep: Reputation: 363Reputation: 363Reputation: 363Reputation: 363
Welcome to LQ!
(Wow: cpanel is new to me! 'spam assassin rules'? You must be a guru vs. noob-me )

This web-search will find you tons of great stuff, guaranteed :
Quote:
linux|unix "find command" tutorial|examples
(Being an old Unix'er, I love all the tricks that `find` can do!) Best wishes!

p.s. another thought: by any chance, is this more related to
MTA/MUA storing emails in /var/spool/mail/<username> or ~/mbox or ...
Or some 'internal' storing by SpamAssassin? (again, I know zero about that)

Can you tell us more about that ".mail" or "./mail" dir?
I'm not clear about: "the emails that you sent from the [dot?]mail directory on your account"
(btw, are you familiar with like: ~john/.mailrc == ~/.mailrc == ./.mailrc ?)

**What exact way/command are you using to send the 3 mail?

Last edited by Jjanel; 12-31-2016 at 06:02 AM.
 
Old 12-31-2016, 05:43 AM   #8
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 5,971
Blog Entries: 3

Rep: Reputation: 3102Reputation: 3102Reputation: 3102Reputation: 3102Reputation: 3102Reputation: 3102Reputation: 3102Reputation: 3102Reputation: 3102Reputation: 3102Reputation: 3102
Quote:
Originally Posted by Johno13 View Post
I am currently starting out at learning all about Linux and am facing some challenges with some of the work I am required to learn. How would one use the find command to locate emails I sent from a .mail directory and the ones that I received?
It also depends on your mail box format. One type puts each mail folder in a single file, one file per mail folder. The other uses the file system to mirror your mail box hierarchy with one file per message. If I understand correctly the former is called mbox and the latter maildir. Only with maildir will you have an easy time using find to search individual messages.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
different find commands to use robertkwild CentOS 16 11-04-2016 01:01 AM
Question using cp and find commands. thornt Linux - Newbie 1 02-10-2015 07:33 PM
Need help to find out some commands kasparov29 Linux - General 4 10-01-2011 06:29 PM
Where to find commands? spotterke Linux - Newbie 4 09-11-2008 05:34 PM
find commands shawniecas Linux - Newbie 4 06-14-2007 12:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration