touch your files
* * * * * 1 votos
November 14th, 2006 toydi Posted in Common, stat, touch | Hits: 5174 |
When you touch a file, you change both its accessed and modified time.
Here’s a file and its status:
$ stat foobar
File: `foobar'
Size: 154 Blocks: 8 IO Block: 4096 regular file
Device: 304h/772d Inode: 167769 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1000/ toydi) Gid: ( 1000/ toydi)
Access: 2006-11-14 22:06:06.000000000 +0800
Modify: 2006-11-14 21:40:05.000000000 +0800
Change: 2006-11-14 21:40:05.000000000 +0800
Now, touch it!
touch foobar
$ stat foobarFile: `foobar' Size: 154 Blocks: 8 IO Block: 4096 regular file Device: 304h/772d Inode: 167769 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 1000/ toydi) Gid: ( 1000/ toydi) Access: 2006-11-14 22:08:38.000000000 +0800 Modify: 2006-11-14 22:08:38.000000000 +0800 Change: 2006-11-14 22:08:38.000000000 +0800
When you touch a file which doesn’t exist, that file will be created. To prevent this, use the -c option.
Live Chat!









November 14th, 2006 at 10:23 pm
When you touch nothing, nothing will be created, and nothing is a file that contains nothing.
November 14th, 2006 at 10:27 pm
mysurface, read like a Zen poem. 8-)