Timeline for Why does touch create new files?
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 15, 2018 at 18:20 | comment | added | George Pantazes |
If this question is about the design of touch rather than how it works, I think touch violates the Single Responsibility Principle with the file creation side effect. Therefore, the "why" is simply due to early design choices that got stuck due to popularity and prevalence/ease of use.
|
|
| Jul 18, 2016 at 12:17 | comment | added | user |
@Tim There's no real reason you couldn't use >/forcefsck or printf '' >>/forcefsck (the latter would preserve any existing contents). What you describe is a way to use a utility that works in a certain way, but that has no real bearing on why it's written to work that way.
|
|
| S Jul 18, 2016 at 8:58 | history | suggested | Aquarius_Girl | CC BY-SA 3.0 |
removed useless info
|
| Jul 18, 2016 at 8:29 | review | Suggested edits | |||
| S Jul 18, 2016 at 8:58 | |||||
| May 14, 2015 at 8:53 | comment | added | Tim |
As a usage case, I use touch /forcefsck to create an empty file called /forcefsck to force file systems to be checked for errors on the next reboot. The file itself doesn't need to contain anything, it just needs to exist. Without touch, I'd need to use vi or nano to save a blank file. Much quicker to use touch.
|
|
| May 14, 2015 at 4:49 | history | edited | Mat | CC BY-SA 3.0 |
deleted 22 characters in body; edited title
|
| May 13, 2015 at 23:48 | answer | added | Gilles 'SO- stop being evil' | timeline score: 17 | |
| May 13, 2015 at 23:10 | answer | added | VaTo | timeline score: 15 | |
| May 13, 2015 at 23:04 | review | First posts | |||
| May 13, 2015 at 23:21 | |||||
| May 13, 2015 at 23:00 | history | asked | Alex McCourt | CC BY-SA 3.0 |