About 8,830,000 results
Open links in new tab
  1. ubuntu - Append date to filename in linux - Stack Overflow

    Nov 25, 2009 · You can add date next to a filename invoking date command in subshell. date command with required formatting options invoked the braces of $() or between the backticks ( `…` ) is executed in a subshell and the output is then placed in the original command.

  2. How To Append Current Date To Filename in Bash Shell

    Apr 5, 2024 · Explains how to append the current date or time to a filename from a shell variable under macOS, Linux, *BSD, and Unix bash shell scripting.

  3. How do you put date and time in a file name? - Unix & Linux

    Mar 17, 2017 · You can get UTC time in your date call by specifying the -u flag and adding "Z" to the end of the datetime string to indicate that the time is UTC like this: $ date -u +"%FT%H%MZ" 2016-04-25T1430Z Share

  4. linux - Write current date/time to a file using shell script - Stack ...

    Apr 5, 2017 · I am trying to use a shell script to write the current date and time to a file. Here is what I have so far. echo "$(date)" >> //home/user/Desktop/Scripts/Date Logs/datelog.txt. It will say it completed but nothing is printed to the file after it is run.

  5. Appending a current date from a variable to a filename

    Feb 11, 2012 · How do I append a current date to a filename? More than likely it is your use of set. That will assign 'today', '=' and the output of the date program to positional parameters (aka command-line arguments). You want to just use C shell (which you are tagging this as "bash", so likely not), you will want to use:

  6. How to create a file with todays date in the filename

    Jan 16, 2018 · You should use double quotes and need to evaluate date +"%F" using command substitution. $ touch "test_$(date +%F)" This will create an empty file test_2018-01-15. Double quote helps you create a single file where some options of date command would include a space.

  7. Quickest way to give file name the current date on Linux

    Oct 4, 2015 · Just use the date command with the + option. We can use backticks to capture the value in a variable. You can change the date format by using different % options as detailed on the date man page. Split a file into name and extension. This is a bit trickier. If we think they'll be only one . in the filename we can use cut with . as the delimiter.

  8. How to append current date and timestamp to filename in shell

    Jul 14, 2020 · Here is how you can format current date and time, and append formatted string to a file name, in a shell script. A linux command line tool called date allows you to format the display of current time as you want.

  9. Appending Dates to Filenames in Bash Scripts - Squash

    Oct 22, 2023 · To append the date to a filename, you can use the date command in combination with string manipulation in a Linux bash script. The date command allows you to format the current date and time in various ways, including specifying the format for the filename.

  10. Append the current date and time to the file name - Unix & Linux

    Mar 29, 2018 · {} is used as a placeholder for the file name, to which we append a date in the desired format. The example formatting +%Y-%m-%d should be self-explanatory. for the date and time, (or date +%F_%T for short in most date implementations). With zsh: # parameter expansion flag. # things up considerably if you have. # zillions of files to copy.

  11. Some results have been removed
Refresh