Which command is used to create a zero size file?
-
cat
-
create
-
touch
-
new
Reveal answer
Fill a bubble to check yourself
C
Correct answer
Explanation
touch filename creates a zero-size (empty) file if the file doesn't exist. While cat can create files when redirecting output, touch is the standard, simplest command specifically designed for creating empty files and updating timestamps.
AI explanation
The Unix/Linux 'touch' command updates a file's timestamps if it exists, or creates a new, empty (zero-byte) file if it doesn't. It's the standard, idiomatic way to create a zero-size file, e.g., 'touch newfile.txt'. 'cat' is used to concatenate/display files (and can create a file only when redirected with input, which isn't its purpose). 'create' and 'new' aren't standard Unix commands at all. So 'touch' is unambiguously correct.