|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
Remove All Characters In A File?
Can I use sed or tr to remove all characters in a file? I want to have just a empty file remaining with nothing in it.
Thanks! |
|
#2
|
|||
|
|||
|
Use -
$ > filename |
|
#3
|
|||
|
|||
|
sweeeeet.
|
|
#4
|
|||
|
|||
|
Hrmm- bash dosn't seem to understand $ as a command. But as a workaround, i simply made a new empty file and just use 'cat blankfile > myfile' to clear it out. I just thought it would be cool to eliminate that extra file.
|
|
#5
|
|||
|
|||
|
or:
cp /dev/null file -Steven __________________ CHISWICK! FRESH HORSES!! –King Richard, Black Adder |
|
#6
|
|||
|
|||
|
Quote:
The $ was the prompt or PS1 and not a command. |
|
#7
|
|||
|
|||
|
or:
cp /dev/null file -Steven __________________ CHISWICK! FRESH HORSES!! –King Richard, Black Adder Whoops, double posted, how do I remove one??? PS, technically the "> file" is not empty. There is one empty line in it (read - carriage return/line feed). Compare the output of such a file (cat) and a newly created file (touch). |
|
#8
|
|||
|
|||
|
echo -n "" > /my/file
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Remove All Characters In A File? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|