mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-22 21:08:12 +08:00
Added new "touch" command (#18805)
Added new useful touch command used for modifying timestamps
This commit is contained in:
parent
bcbc4c5416
commit
04eed15fe5
26
client/src/pages/guide/english/bash/bash-touch/index.md
Normal file
26
client/src/pages/guide/english/bash/bash-touch/index.md
Normal file
@ -0,0 +1,26 @@
|
||||
---
|
||||
title: Bash touch
|
||||
---
|
||||
|
||||
## Bash command: touch
|
||||
|
||||
**Change timestamps of files.**
|
||||
|
||||
```
|
||||
touch [options] filename
|
||||
```
|
||||
|
||||
Creates empty file if not exists or modify times of existing files to current time.
|
||||
|
||||
Commonly used options:
|
||||
- `-t` change timestamp to specific date ((YYYYMMDDHHMM.SS)) instead of current time.
|
||||
- `-r` use timestamp from first file to second file.
|
||||
|
||||
Examples:
|
||||
```
|
||||
touch -t YYYYMMDDHHMM.SS filename
|
||||
touch -r file1 file2
|
||||
```
|
||||
|
||||
### More Information:
|
||||
* [Man pages](http://man7.org/linux/man-pages/man1/touch.1.html)
|
||||
Loading…
Reference in New Issue
Block a user