Linux Touch Command

every file in linux is associated with timestamps,which specifies the last access time,last modification time and last change time.whenever we create a new file,or modify an existing file or its atributes,these timestamps will be updated automatically.

touch command is used to change these timestamps(access time,modification time,and change time of a file,touch command will create an empty file(0 byte),it does not allow user to store anything in the file.it will just create an empty file with giving filename.

Syntax

$touch [options] [file_name]

Example


$touch demo
							 

it will create empty new file called "demo"

Options

Sr.No

Options

Descriptions

01

-m

to change modification time of a file.

02

-a

to change access time of a file.

03

-c

to avoid creating a file,if already exist.

04

-d

to allow the user to add a specific last access time.the former is followd by a string in the date,month,year,minute:second: format.

Share Share on Facebook Share on Twitter Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit

You may also like this!