Unix shell script

Posted on 2014-08-08
Last Modified: 2014-08-14
How to create the file with time stamp in unix shell script ?
Question by:digs developer
    LVL 23

    Accepted Solution

    Something like this?
    DATE=`date "+%Y%m%d-%H%M%S"`
    echo "this is something in my new file" > $FILE

    Open in new window

    LVL 84

    Expert Comment

    Or do you mean this?
    touch file

    Open in new window

    LVL 48

    Expert Comment

    touch file_$(date +%Y%m%d)


    echo "Some text" >file_$(date +%Y%m%d)

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (…
    Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now