using date

Asked by princen

how do i Put the output of date in a file,append the output of ls to this file and Send this file to my local mailbox (don't specify anything <@domain>, just the user name will do). When using Bash, a mail should be seen.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Jim Hutchinson
Solved:
Last query:
Last reply:
Revision history for this message
Best Jim Hutchinson (jphutch) said :
#1

I can answer the first part of this but not sure about having it mailed.

Use a > to send something to a file

date > ~/Desktop/file.txt

To append to it use >>

ls >> ~/Desktop/file.txt

ls - l will give more details if you want like owner and permissions.

Revision history for this message
princen (spurchampion) said :
#2

Thanks Jim Hutchinson, that solved my question.