Linux Touch- An Easy Way To Create File

Linux Touch command is another way of creating files in Linux.

admin@sangkrit:~/test$ touch file1
admin@sangkrit:~/test$ touch file2
admin@sangkrit:~/test$ touch file555
admin@sangkrit:~/test$ ls -l
total 0
-rw-r–r– 1 admin admin 0 2007-01-10 21:40 file1
-rw-r–r– 1 admin adminĀ 0 2007-01-10 21:40 file2
-rw-r–r– 1 admin adminĀ 0 2007-01-10 21:40 file555

touch -t

Touch can do much more than just creating files.Check touch manual for info

admin@sangkrit:~/test$ touch -t 200505050000 OpensourceBook
admin@sangkrit:~/test$ touch -t 130207111630 OpenBook
admin@sangkrit:~/test$ ls -l
total 0
-rw-r–r– 1 admin admin 0 1302-07-11 16:30 OpenBook
-rw-r–r– 1 admin admin 0 2005-05-05 00:00 OpensourceBook

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.