command 'touch -c file/dir'


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users command 'touch -c file/dir'
# 1  
Old 11-19-2005
command 'touch -c file/dir'

Dear expert,

what is this command touch -c filename using for?
I find if execute and filename is existed, it update the date to now.
If the filename is not exeisted, it don't create the file..
so what is this command using for?

Thank a lot!
# 2  
Old 11-20-2005
Quote:
Originally Posted by zp523444
Dear expert,

what is this command touch -c filename using for?
I find if execute and filename is existed, it update the date to now.
If the filename is not exeisted, it don't create the file..
so what is this command using for?

Thank a lot!
You've answered your own question. Smilie The 'touch' command is there to change file dates. When run with no particular paramaters except filenames, it sets the date on those files to the current time. It will create nonexistent filenames, except when the '-c' flag is given, as you've observed.

For details, refer to 'man touch'.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Command / Script to create touch file in destination server

Hello Team, Is there any Linux command / script available so that, I could create a simple 0 byte file in destination server by issuing the command from source server. If yes, Could you please let me know the possible solutions. in other words I just want to create a touch file in my home... (1 Reply)
Discussion started by: madhuraju
1 Replies

2. Shell Programming and Scripting

Needed touch command to create a file in the following format

needed touch command to create a file in the following format touch a_yyyymmdd_hhmmss (1 Reply)
Discussion started by: hemanthsaikumar
1 Replies

3. Shell Programming and Scripting

Create file Dir and Sub Dir same time

Hi Guys , I want create files Dire and Sub Dire. as same time using variable. EX: x1="/hk/Pt/put/NC/R1.txt" x2="/hk/pt/Put/Ot/NC/RN.txt" And i want delete all after done with my script. Thanks (2 Replies)
Discussion started by: pareshkp
2 Replies

4. UNIX for Dummies Questions & Answers

How to list all files in dir and sub-dir's recursively along with file size?

I am very new to unix as well as shell scripting. I have to write a script for the following requirement. In have to list all the files in directory and its sub directories along with file path and size of the file Please help me in this regard and many thanks in advance. (3 Replies)
Discussion started by: nmakkena
3 Replies

5. UNIX for Dummies Questions & Answers

touch command

Is there a way to do... touch ./config/newdir/newfile if neither newdir and newfile exists? man touch tells me there's not (?) Is out there another tool to do that? Thx in advance! :b: (6 Replies)
Discussion started by: funyotros
6 Replies

6. UNIX for Dummies Questions & Answers

Copying dir (and sub dir) file names from ftp server to txt file in diff server

Hey all, i want to copy only the file names from an ftp server (directory and all sub directory) to a text file in another server (non ftp), i.e. i want to recursively move through directories and copy only the names to a text file. any help is appreciated...thank you in advance (1 Reply)
Discussion started by: deking
1 Replies

7. Shell Programming and Scripting

Moving file(s) from dir to dir

Hi, I am fairly new to writing scripts. I am trying to write a script that moves either One or All of the files from one directory to another. I know how to make the actual command to do it, but i don't quite know how to add operators to it, ie -i or -a. I want -i to move one file from... (4 Replies)
Discussion started by: SirJoeh
4 Replies

8. Shell Programming and Scripting

copying a file from one dir to another dir

hi i have a script compareFiles() { find /tmp/Satya -type f | \ while read filename1 do echo "----------------------------------------$filename1" find /tmp/Satya -type f | \ while read filename2 do if diff $filename1 $filename2 then echo "Both files... (3 Replies)
Discussion started by: Satyak
3 Replies

9. UNIX for Dummies Questions & Answers

touch command help

Hi, This might be the stupidest question ever but here it goes, i need to create a file with the name Hello! It's $s It using the touch command but whenever i use touch 'Hello! It's $s' i get s is undefined touch Hello! It's $s i get ' unmatched Please help ^_^ (6 Replies)
Discussion started by: wsn
6 Replies

10. UNIX for Advanced & Expert Users

Command similar to "touch" for modify File size

Hi All, I'm trying to find a command like similar to "touch" which would let me change the file size property. For ex: I have a file of size 1MB using the command i would like to set/update the size something like 1KB. Is it possible? Is there any such command which would accomplish this... (3 Replies)
Discussion started by: sriharshareddyk
3 Replies
Login or Register to Ask a Question