9 Useful Examples of Touch Command in Linux

'Touch command in Linux is used for changing file timestamps however one of the most common usages of touch command includes creating a new empty file. With the touch command, you can change access, modify and change time of files and folders in Linux. You can update the timestamps or modify them to a date in the past.' -- source: https://linuxhandbook.com/touch-command/ To be honest, I only ever use it to create an empty file... Cheers, Peter -- Peter Reutemann Dept. of Computer Science University of Waikato, NZ +64 (7) 858-5174 http://www.cms.waikato.ac.nz/~fracpete/ http://www.data-mining.co.nz/

On Mon, Sep 10, 2018 at 01:36:19PM +1200, Peter Reutemann wrote:
'Touch command in Linux is used for changing file timestamps however one of the most common usages of touch command includes creating a new empty file.
With the touch command, you can change access, modify and change time of files and folders in Linux. You can update the timestamps or modify them to a date in the past.'
-- source: https://linuxhandbook.com/touch-command/
To be honest, I only ever use it to create an empty file...
It's also useful for tricking make into thinking some file is newer when it is not! Cheers Michael.
participants (2)
-
Michael Cree
-
Peter Reutemann