![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| File is not empty? | lesstjm | Shell Programming and Scripting | 7 | 07-12-2007 07:21 AM |
| File created time | yakyaj | UNIX for Advanced & Expert Users | 6 | 03-23-2007 06:20 AM |
| file was created before 15 days ago. | YoungBlood | UNIX for Dummies Questions & Answers | 1 | 03-02-2007 10:23 AM |
| want to cat the latest log file created | vkandati | UNIX for Dummies Questions & Answers | 1 | 03-08-2005 03:13 PM |
| File Created On attribute | dpalmer | UNIX for Dummies Questions & Answers | 1 | 09-16-2001 07:44 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
How to empty a file(already created)
What is the command to empty an already existing file.
please provide me.i used Touch cmd to empty the file.but it changing the time only. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Code:
> file Code:
: > file |
|
#3
|
|||
|
|||
|
i need to empty a file which is already existing.
|
|
#4
|
|||
|
|||
|
cat </dev/null >file
|
|
#5
|
||||
|
||||
|
The command works also for an existing file :
Code:
$ ls -l my_file -rw-r--r-- 1 Jean-Pierre Aucun 8943 Jul 4 18:55 my_file $ > my_file $ ls -l my_file -rw-r--r-- 1 Jean-Pierre Aucun 0 Jul 4 18:56 my_file $ |
||||
| Google The UNIX and Linux Forums |