terminal.cab
No.
8
Date
Learning goal
Terminal Start, lesson 4
Level
1 of 3

Command of the day No. 8: touch

Purpose: Creates an empty file or updates its time.

Syntax: touch file

Example:

ls -l todo.txt
-rw-r--r-- 1 lerner lerner 37 Oct 17 08:15 todo.txt
touch todo.txt
ls -l todo.txt
-rw-r--r-- 1 lerner lerner 37 Oct 17 09:00 todo.txt

Output from the simulator, as on a real Linux.

Options:

Try it in the terminal Share image

Fills in the command. Nothing runs until you press Enter.

Command of the day No. 8: touch. Purpose: Creates an empty file or updates its time. Example: ls -l todo.txt; touch todo.txt; ls -l todo.txt. Caution: On an existing file touch keeps the content but changes the time, so ls -lt and backups see it as new. Check first: ls -l file shows whether it exists and its current time. Remember: touch never empties a file, it only sets the time.
The same card as an image, 1080 x 1350 pixels.

Today's card ยท All cards so far