ready.flag does not exist yet.
Create an empty ready.flag in the current directory.
Which command is appropriate?
touch creates a missing file with no contents. For an existing file it updates timestamps by default.
Detailed explanation
mkdir ready.flagIncorrect. mkdir creates a directory, not a regular file.
cat ready.flagIncorrect. cat attempts to read the file and does not create it as requested.
rm ready.flagIncorrect. rm removes a file rather than creating one.
touch ready.flagCorrect. touch creates ready.flag as an empty file when it is absent.
Try it yourself
An example you can run in a temporary verification environment.
rm -f /tmp/kp-ready.flag && touch /tmp/kp-ready.flag && test ! -s /tmp/kp-ready.flag && echo EMPTY && rm /tmp/kp-ready.flagExpected result
EMPTYKey points
- Create a missing empty file
- Existing files receive new timestamps
- touch does not add content
Notes
- Environment: GNU coreutils 9.x
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.