1、获取上一天

1)代码

date -d "1 days ago" +%Y-%m-%d

2)结果

【Linux】linux | shell | 获取日期_shell

 

~~