Hi folks,
How do we create a file using shell script?
i mean to say that do we use
is it a good approch to do
echo "abc" >file
echo "xxxx" >>file
or is there any better method?
Thanks,
Amit
Hi folks,
How do we create a file using shell script?
i mean to say that do we use
is it a good approch to do
echo "abc" >file
echo "xxxx" >>file
or is there any better method?
Thanks,
Amit
try this
cat > 111
After this type text and press ^d to save a file.
Both approaches are correct what really matter is your choice.
you can create file using ">" operator and later you can append on same file with ">>" operator.
why not using touch?
ex. touch filename
cu
lowbyte
Thanks to all of you,this almost satisfies my querry.
If you need a file with a certain size, use dd command or check the man pages depending on your needs.
The last thing I needed was to create 150GB file, I did it like that :
dd if=/dev/zero of=150g bs=1073741824 count=150