Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

date format in linux shell script

date_now=$(date "+%F-%H-%M-%S")
Comment

date in - format linux

# put current date as yyyy-mm-dd in $date
date=$(date '+%Y-%m-%d')

# put current date as yyyy-mm-dd HH:MM:SS in $date
date=$(date '+%Y-%m-%d %H:%M:%S')

# print current date directly
echo $(date '+%Y-%m-%d')
Comment

PREVIOUS NEXT
Code Example
Shell :: linux remove all node_modules folders 
Shell :: git delete last commit local and remote 
Shell :: psycopg2.OperationalError: could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432? 
Shell :: bash echo can create file 
Shell :: tar all files and subdirectories 
Shell :: extract rockyou.txt kali linux 
Shell :: how to check what version of cmake installed 
Shell :: install composer wsl 
Shell :: create new branch from origin 
Shell :: install CMake on fedora 
Shell :: create repo from cmd 
Shell :: unregister distro 
Shell :: apt install zbar 
Shell :: install composer mac 
Shell :: powershell download a file from url 
Shell :: close all localhost connections 
Shell :: change commit date linux 
Shell :: kubernetes archlinux install 
Shell :: install readline-sync 
Shell :: docker restart 
Shell :: chkconfig httpd on Amazon Linux 2 AMI 
Shell :: install github linux 
Shell :: locate all exe file in powershell 
Shell :: remove module and clear cache and install npm w expo 
Shell :: shell: search a substring in another string 
Shell :: zsh create alias 
Shell :: stop localhost server 
Shell :: install protonvpn on linux mint 
Shell :: clear history centos 
Shell :: settings not showing in ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =