Unix3 - Problem 1. The touch command is useful for a couple...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Problem 1. The touch command is useful for a couple reasons. It can change the access times, modification times, or both for a file. It also specifies that if the file identified does not exist, the file is created and the access and modification times are set as specified. If the user doesn’t specify a time then the current time is used as the timestamp. Ex. If myFile doesn’t exist touch myFile.txt Creates the file with the computer’s current time as the timestamp. If myFile does exist touch myFile.txt Changes the timestamp to the computer’s current time. Following cases assume myFile already exists touch -t 200903300830.46 myFile.html Changes the time of the file by using numbers only. (yyyymmddhhmm.ss) touch -d '2009-03-30 8:30:46' myFile.html Changes the time of the file by using numbers in a more formatted way. (yyyy-mm-dd hh:mm.ss) touch -d 'Mar 30 2009 8:30:46' myFile.html Changes the time of the file by using the month name and different format.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

Unix3 - Problem 1. The touch command is useful for a couple...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online