Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Unix 中,如何找到模式:mm/dd/yyyy hh:mm在文件中并将其替换为mm/dd/yyyy?
mm/dd/yyyy hh:mm
mm/dd/yyyy
这是一种方法sed:
sed
sed -r 's|([0-9]{2}/[0-9]{2}/[0-9]{4}) [0-9]{2}:[0-9]{2}|\1|g'