Linux/Unix – Managing Files…

Managing Files

File management tools include those for splitting, comparing, and compressing files, making backup archives, and tracking file revisions. Other management tools exist for determining the contents of a file, and for changing its timestamp.

 

Changing File Modification Time

Use touch to change a file’s timestamp without modifying its contents. Give the name of the file to be

changed as an argument. The default action is to change the timestamp to the current time.

To change the timestamp of file `pizzicato’ to the current date and time, type:

$ touch pizzicato

To specify a timestamp other than the current system time, use the `−d’ option, followed by the date and time that should be used enclosed in quote characters. You can specify just the date, just the time, or both.

To change the timestamp of file `pizzicato’ to `17 May 1999 14:16′, type:

$ touch −d ’17 May 1999 14:16′ pizzicato

To change the timestamp of file `pizzicato’ to `14 May’, type:

$ touch −d ’14 May’ pizzicato

To change the timestamp of file `pizzicato’ to `14:16′, type:

$ touch −d ’14:16′ pizzicato

 

NOTE: When only the date is given, the time is set to `0:00′; when no year is given, the current year is used. See Info file `fileutils.info’, node `Date input formats’, for more information on date input formats.

Advertisements

About msotela

This blog is for anyone who wants to access the power of a Linux system as a systems administrator or user. You may be a Linux enthusiast, a Linux professional, or possibly a computer professional who is increasingly finding the Windows systems in your data center supplanted by Linux boxes.

Posted on March 15, 2009, in Unix/Linux. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: