Command of the day (06 Oct) - touch

codlinuxtouch

touch - Create empty file/update timestamp

    touch file1 file2: Create file1 and file2 files. Update timestamp if files exist

    touch file{1..10}.txt: Creates 10 files

    touch dir/{a,b}: Creates files dir/a and dir/b

    touch -a file: Change access time of foo

    touch -m file: Change modification time of foo

    touch -r file1 file2: Uses times from file1 instead of current time

    touch -t 202601012310 file: Changes foo timestamp to 1 Jan 2026 23 10

    find . -exec touch {} \;: Update timestamps recursively

Return to Home Page