You can use touch -c option to not create any new file if it does not already exist. By default, touch will create the file if not already exists.
Example:
Create an empty file
1 2 |
## Create a new empty file touch myfile |
List all available files and directories
1 2 |
## list all available files ls -last ## a new file named myfile has been created |
touch -c option
1 2 |
## touch -c option touch -c mynewfile ## do not create the file if not exist |
List all available files and directories
1 2 3 4 |
## list all available files ls -last ## mynewfile was not created due to -c option rm my* |