Reputation: 251
I need to extract the minute value from the Linux "date" command. The online guides are really confusing. Can you help please?
Upvotes: 2
Views: 665
Reputation: 32398
It sounds like you want:
date +%M
This will print just the minute value and you can assign it to a variable with:
dat=`date +%M`
echo $dat
Upvotes: 5
Reputation: 9403
You can try
date +%M
For getting it directly .
or this
date | awk '{print $4}' | cut -d ":" -f 2
for getting it indirectly
Upvotes: 0