Originally Posted by chetanpatel
I want to make a file empty which contain some data.
I am trying as follows
echo "" > filename.
but it is not working.
You said: "I want to make a file empty which contain some data."
Answer 1: If you truly mean CREATING (make) "file" that contains nothing do this:
$ touch <filename>
this creates an empty file. Check if it is there: ls -l <filename>
Answer 2: But if you mean a "folder" (since folder is considered file) do this:
$ cd <folder> (that's to get inside the folder)
$ rm -rf * (that deletes all files inside it and subfolders as well)
==>Notabene: This rm -fr is dangerous, be certain what you are doing. Also it cannot delete files/folders that you did not create: to overcome this you must login as root first then cd to the directory folder the contents of which you wanted to delete. Sometimes you need to own them first by chown if the UID that created it belonged somewhere from other galaxy; do this:
# chown root:root *
then you can execute the verdict above.
[The multitude of my answers sprang out not from my loquacity but from my sincere inclination to help despite your very "vague" question. I understand that we in this forum came from several languages and our English just vary from all sides. For this you may pardon my long answer to a short question.]
Anyway, I hope this helps.
Be careful. Goodluck.