From c1a467c13a0577d8bc7c778c3ae4a2f497391e74 Mon Sep 17 00:00:00 2001 From: Emily Grace Seville Date: Thu, 15 Dec 2022 22:28:53 +1000 Subject: [PATCH] touch: refresh (#7966) * Don't use brace expansion syntax in last sample * Use brace expansion without file extension * Refresh page: - better grammar in descriptions - better command page description - refresh examples * Add `--no-create` option * Better descriptions and placeholder: - don't use brace expansion - remove hint in braces * Reduce repetition in placeholders * Add OSx touch command * Use imperative mood * Apply suggestions from code review * Apply suggestions from code review * Use an actual value for --reference * Use an actual value for -r * Simplify placeholders and enhance descriptions * Leave just common/touch.md * Use short options * Update "More information" link --- pages/common/touch.md | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/pages/common/touch.md b/pages/common/touch.md index 9ba7657d7..93dd4270e 100644 --- a/pages/common/touch.md +++ b/pages/common/touch.md @@ -1,24 +1,20 @@ # touch -> Change a file access and modification times (atime, mtime). -> More information: . +> Create files and set access/modification times. +> More information: . -- Create a new empty file(s) or change the times for existing file(s) to current time: +- Create specific files: -`touch {{path/to/file}}` +`touch {{path/to/file1 path/to/file2 ...}}` -- Set the times on a file to a specific date and time: +- Set the file [a]ccess or [m]odification times to the current one and don't [c]reate file if it doesn't exist: -`touch -t {{YYYYMMDDHHMM.SS}} {{path/to/file}}` +`touch -c -{{a|m}} {{path/to/file1 path/to/file2 ...}}` -- Set the time on a file to one hour in the past: +- Set the file [t]ime to a specific value and don't [c]reate file if it doesn't exist: -`touch -d "{{-1 hour}}" {{path/to/file}}` +`touch -c -t {{YYYYMMDDHHMM.SS}} {{path/to/file1 path/to/file2 ...}}` -- Use the times from a file to set the times on a second file: +- Set the file time of a specific file to the time of anothe[r] file and don't [c]reate file if it doesn't exist: -`touch -r {{path/to/file1}} {{path/to/file2}}` - -- Create multiple files: - -`touch {{path/to/file{1,2,3}.txt}}` +`touch -c -r {{~/.emacs}} {{path/to/file1 path/to/file2 ...}}`