Tuesday, October 14, 2014

What are the important applications of touch command in linux?

If we write touch filename then only the time at which the file has been accessed gets changed in the linux records.This command doesn't open the file.

What other things can we do using touch command?

1. Creating an empty file

touch a.txt

2. Creating multiple empty files

touch a.txt b.txt c.txt

3. touch -a random.txt

touches the file random.txt and if the file is not present creates a new file with the name.

4. touch -c random.txt

touches the file random.txt and if the file is not present it doesn't create a new file.

5. touch -r random.txt alpha.txt

updates the timestamp of file alpha with the timestamp of file random.txt

6. touch -t 201410152030.40 random.txt

this command will give random.txt file a timestamp of 15th october 2014 and 8 30 PM and 40 seconds.

3 comments:

  1. Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site.
    Ios app development in hyderabad
    Best ios training in hyderabad
    Iphone app development in hyderabad

    ReplyDelete
  2. IBM Certifications crack4sure Actually its very nice site! this is my first visit on this site my friend gave the link of this site! and site is really great

    ReplyDelete