Test if file exists and do things

PHOTO EMBED

Sat Aug 20 2022 19:57:16 GMT+0000 (Coordinated Universal Time)

Saved by @jmbenedetto #bash

test -e ./file_path/file_name && echo 1 || echo 2
content_copyCOPY

check if file exists (-e) If yes (&&) if no (||)

https://www.computerhope.com/unix/test.htm