How to use the Linux shell will file modification time differ with the current system time display how many seconds
CodePudding user response:
The shell can't do that, write a program yourself, using the stat function for file information
CodePudding user response:
#!/bin/bash
Time1=$(stat - t $1 | awk '} {print $12)
Time2=$(date + % s)
Echo ` expr $Time2 - $Time1 `
CodePudding user response: