The following command can get the modification time of the remote file, how to modify the output time format?

# curl -sI https://sgp-ping.vultr.com/vultr.com.100MB.bin | grep Last-Modified | cut -c16-
Mon, 29 Apr 2019 20:22:54 GMT

I want to convert to Y-m-d H:i:s time format. any help is much appreciated.

1 Answer 1


pipe it to date command and use its formatting controls to format as you expect like:

... |date -f- '+%Y-%m-%d %T'

see more formatting controls in man date


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .