How to Change the File Name With Date Command

How to Change the File Name With Date Command thumbnail
The date command is a simple line of code.

The date command allows you to place a specific date in a line of text without having to check and be sure that you have your days correct. The command signals the computer to provide its current working date, which should be correct and can help to authenticate files that you're saving. If you want to adjust your file name using the date command in UNIX, you'll only have to type a few lines of very simple code.

Instructions

    • 1

      Create your date command by typing: date '+%d%m%y'. Do not include the period. This should give you a date without any formatting. For example, January 12, 2009 would appear as 011209.

    • 2

      Include the punctuation mark you wish to use after each letter in the date string if you wish to have punctuation between the numbers. For example, you would write date '+%d. %m. %y' to have your date formatted with periods between the numbers. January 12, 2009 would appear as 01.12.09. Do not use slashes in your code, as this signals UNIX to ignore the text, not to input a slash.

    • 3

      Create your file name by inserting the code: FILENAME=Smith before your date information. Smith, in this case, is the name of the document. You would replace Smith with the file name you're trying to create.

    • 4

      Surround the date information with single quotes once you've included the file name command. This means there will be two single quote marks at the end of the data string. The entire data string should appear as: FILENAME=Smith. 'date '+%d. %m. %y''

Related Searches:

References

  • Photo Credit little girl and computer image by Renata Osinska from Fotolia.com

Comments

You May Also Like

Related Ads

Featured