Skip to main content
Drupal 8

Main navigation

  • Home
    • Question And Answer
    • NEWS
    • Projects
  • Tutorials - Drupal
    • Android
    • Other
User account menu
  • Log in

Breadcrumb

  1. Home

Date on Linux Shell / Bash command line

By editor , 26 June, 2017
Question

Few tips for linux terminal date. manipulate date on linux CLI.

Print / Check Date from command line

date

Set date from the command line

date +%Y%m%d -s "20170430"

Set time from the command line

date +%T -s "12:00:00"

Set time and date from the command line

date -s "30 APR 2017 12:00:00"

 

Print / Get a formatted dater

DATE=$(date +%d-%m-%Y" "%H:%M:%S);
echo  $(date +%d-%m-%Y" "%H:%M:%S);

Write a file using current timestamp as file name.

echo "test"> "File-$(date +%Y%m%d%H%M%S).txt";

Tags

  • Linux
  • Shell
Linux shell output - Handle StdOut
Create interactive shell script. Prompt for Yes / No input
Linux Shell - Process bulk Images

Comments

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.

Links

  • Drupal.org
  • Drupal core release cycle
  • Drupal events with ease
  • Unit test with Drupal using PHPUnit (Drupal 10)
  • Tokens for file upload url
  • Tips for Docker
  • CKEditor inline image files usage for custom forms.
  • Install Docker on Linux Mint
  • Install PHP 8.1
  • Drupal Security Best Practices
  • Order and sort items with tabledrag
  • Add a custom service YAML container
  • Apply a patch with composer