Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 05-12-2004, 03:38 PM   #1
Registered: Mar 2004
Posts: 132

Rep: Reputation: 15
use date as output filename?


This should be a very easy one for most people and I have done this before, just can't recall how exactly.

What I want to do is run a script, pipe output to a file and use the date as (part of) the filename. Can anyone please remind me?
Old 05-12-2004, 03:39 PM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Try something like:
somecommand > myfile-`date +%F_%T`.txt


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
logrotate with date in filename ptp Linux - Newbie 1 04-14-2011 10:55 AM
adding date timestamp to filename markraem Solaris / OpenSolaris 2 11-17-2004 08:32 AM
put date as part of filename box_l Programming 3 07-27-2004 06:17 AM
Script add date to filename amphion Linux - Newbie 2 06-02-2004 07:12 AM
how to add date to filename x2000koh Programming 1 07-08-2003 09:44 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:34 PM.

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