* Re: File size
2004-08-08 9:00 File size Anindya Mozumdar
@ 2004-08-08 9:16 ` Sascha Retzki
2004-08-08 11:44 ` Roberto Vanto
` (6 subsequent siblings)
7 siblings, 0 replies; 17+ messages in thread
From: Sascha Retzki @ 2004-08-08 9:16 UTC (permalink / raw)
To: linux-admin
Am So, 2004-08-08 um 11.00 schrieb Anindya Mozumdar:
> Hi,
> How can I make a file zero length without deleting the contents of
> the file manually through an editor ?
echo -n "">foo
> Anindya.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: File size
2004-08-08 9:00 File size Anindya Mozumdar
2004-08-08 9:16 ` Sascha Retzki
@ 2004-08-08 11:44 ` Roberto Vanto
2004-08-08 11:55 ` Aroop MP
2004-08-08 12:01 ` File size Sascha Retzki
2004-08-08 12:44 ` Tim Walberg
` (5 subsequent siblings)
7 siblings, 2 replies; 17+ messages in thread
From: Roberto Vanto @ 2004-08-08 11:44 UTC (permalink / raw)
To: linux-admin
Anindya Mozumdar ha scritto:
> Hi,
> How can I make a file zero length without deleting the contents of
> the file manually through an editor ?
> Anindya.
> -
man touch
touch foo
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: File size
2004-08-08 11:44 ` Roberto Vanto
@ 2004-08-08 11:55 ` Aroop MP
2004-08-09 21:14 ` File size (shortest possible solution) + don't touch Stephen Samuel
2004-08-08 12:01 ` File size Sascha Retzki
1 sibling, 1 reply; 17+ messages in thread
From: Aroop MP @ 2004-08-08 11:55 UTC (permalink / raw)
To: Roberto Vanto, linux-admin
You can make a file zero length by cat > foo and by typing CTRL-D
On Sunday 08 Aug 2004 5:14 pm, Roberto Vanto wrote:
> Anindya Mozumdar ha scritto:
> > Hi,
> > How can I make a file zero length without deleting the contents of
> > the file manually through an editor ?
> > Anindya.
> > -
>
> man touch
>
> touch foo
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Regards,
Aroop M.P
Bobcares Support Team
---------------------------------------------------
"NO MATTER WHERE YOU ARE IN THE WORLD,IF YOU HAVE DECIDED TO DO SOMETHING
DEEP FROM YOUR HEART YOU CAN DO IT. IT HAS ALWAYS BEEN THE THOUGHT THAT
MATTERS... "
---------------------------------------------------
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: File size (shortest possible solution) + don't touch
2004-08-08 11:55 ` Aroop MP
@ 2004-08-09 21:14 ` Stephen Samuel
2004-08-09 22:47 ` Daniel Berlin
0 siblings, 1 reply; 17+ messages in thread
From: Stephen Samuel @ 2004-08-09 21:14 UTC (permalink / raw)
To: Aroop MP; +Cc: Roberto Vanto, linux-admin
the shortest possible:
` > somefile `
(( redirect the output of no command at all to somefile ))
Although not necessary, I'll often go
` true > somefile `
True does nothing other than return success. The reason why
I like using it is that it makes a placeholder so that a reader
knows that something (or rather explicitly nothing) is happening.
`Touch` doesn't work.. If the file already exists, it will simply
change the last mod-time. without altering the contents
The original purpose of touch (I think) was to convince make(1) that
something needed to be done.
Anindya Mozumdar wrote:
> Hi,
> How can I make a file zero length without deleting the contents of
> the file manually through an editor ?
> Anindya.
--
Stephen Samuel +1(604)876-0426 samuel@bcgreen.com
http://www.bcgreen.com/~samuel/
Powerful committed communication. Transformation touching
the jewel within each person and bringing it to light.
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: File size (shortest possible solution) + don't touch
2004-08-09 21:14 ` File size (shortest possible solution) + don't touch Stephen Samuel
@ 2004-08-09 22:47 ` Daniel Berlin
0 siblings, 0 replies; 17+ messages in thread
From: Daniel Berlin @ 2004-08-09 22:47 UTC (permalink / raw)
To: linux-admin
How about
: > file
'' : '' does really absolutely nothing
daniel
Am Mo 09.08.2004 23:14 schrieb Stephen Samuel <samuel@bcgreen.com>:
> the shortest possible:
> ` > somefile `
> (( redirect the output of no command at all to somefile ))
>
> Although not necessary, I'll often go
> ` true > somefile `
> True does nothing other than return success. The reason why
> I like using it is that it makes a placeholder so that a reader
> knows that something (or rather explicitly nothing) is happening.
>
>
> `Touch` doesn't work.. If the file already exists, it will simply
> change the last mod-time. without altering the contents
>
> The original purpose of touch (I think) was to convince make(1) that
> something needed to be done.
>
> Anindya Mozumdar wrote:
> > Hi,
> > How can I make a file zero length without deleting the contents of
> > the file manually through an editor ?
> > Anindya.
>
>
> --
> Stephen Samuel +1(604)876-0426 samuel@bcgreen.com
> http://www.bcgreen.com/~samuel/
> Powerful committed communication. Transformation touching
> the jewel within each person and bringing it to light.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: File size
2004-08-08 11:44 ` Roberto Vanto
2004-08-08 11:55 ` Aroop MP
@ 2004-08-08 12:01 ` Sascha Retzki
2004-08-08 13:10 ` Aroop MP
1 sibling, 1 reply; 17+ messages in thread
From: Sascha Retzki @ 2004-08-08 12:01 UTC (permalink / raw)
To: linux-admin
Am So, 2004-08-08 um 13.44 schrieb Roberto Vanto:
> Anindya Mozumdar ha scritto:
> > Hi,
> > How can I make a file zero length without deleting the contents of
> > the file manually through an editor ?
> > Anindya.
> > -
>
> man touch
>
> touch foo
touch changes the timestamp if the file exists. It sounds like the file
already exists. btw, You don't need to delete it through an editor, "rm
foo ; touch foo" would do it, too. ;-)
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: File size
2004-08-08 12:01 ` File size Sascha Retzki
@ 2004-08-08 13:10 ` Aroop MP
2004-08-08 13:20 ` Sascha Retzki
2004-08-08 13:57 ` John Julian
0 siblings, 2 replies; 17+ messages in thread
From: Aroop MP @ 2004-08-08 13:10 UTC (permalink / raw)
To: lantis, linux-admin
How can i attach one file on the top of another file.
Suppose file1 has 10 lines and file2 has 20 lines. I want to attach the 10
lines of file1 to file2 so that the file2 will have 30 lines in total.
On Sunday 08 Aug 2004 5:31 pm, Sascha Retzki wrote:
> Am So, 2004-08-08 um 13.44 schrieb Roberto Vanto:
> > Anindya Mozumdar ha scritto:
> > > Hi,
> > > How can I make a file zero length without deleting the contents of
> > > the file manually through an editor ?
> > > Anindya.
> > > -
> >
> > man touch
> >
> > touch foo
>
> touch changes the timestamp if the file exists. It sounds like the file
> already exists. btw, You don't need to delete it through an editor, "rm
> foo ; touch foo" would do it, too. ;-)
>
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Regards,
Aroop M.P
Bobcares Support Team
---------------------------------------------------
"NO MATTER WHERE YOU ARE IN THE WORLD,IF YOU HAVE DECIDED TO DO SOMETHING
DEEP FROM YOUR HEART YOU CAN DO IT. IT HAS ALWAYS BEEN THE THOUGHT THAT
MATTERS... "
---------------------------------------------------
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: File size
2004-08-08 13:10 ` Aroop MP
@ 2004-08-08 13:20 ` Sascha Retzki
2004-08-08 13:57 ` John Julian
1 sibling, 0 replies; 17+ messages in thread
From: Sascha Retzki @ 2004-08-08 13:20 UTC (permalink / raw)
To: linux-admin
Am So, 2004-08-08 um 15.10 schrieb Aroop MP:
> How can i attach one file on the top of another file.
>
> Suppose file1 has 10 lines and file2 has 20 lines. I want to attach the 10
> lines of file1 to file2 so that the file2 will have 30 lines in total.
>
cat file1 file2 >file3
> On Sunday 08 Aug 2004 5:31 pm, Sascha Retzki wrote:
> > Am So, 2004-08-08 um 13.44 schrieb Roberto Vanto:
> > > Anindya Mozumdar ha scritto:
> > > > Hi,
> > > > How can I make a file zero length without deleting the contents of
> > > > the file manually through an editor ?
> > > > Anindya.
> > > > -
> > >
> > > man touch
> > >
> > > touch foo
> >
> > touch changes the timestamp if the file exists. It sounds like the file
> > already exists. btw, You don't need to delete it through an editor, "rm
> > foo ; touch foo" would do it, too. ;-)
> >
> > > -
> > > To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> > > the body of a message to majordomo@vger.kernel.org
> > > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: File size
2004-08-08 13:10 ` Aroop MP
2004-08-08 13:20 ` Sascha Retzki
@ 2004-08-08 13:57 ` John Julian
1 sibling, 0 replies; 17+ messages in thread
From: John Julian @ 2004-08-08 13:57 UTC (permalink / raw)
To: Aroop MP; +Cc: lantis, linux-admin
To append file1 to file2 do:
cat file1 >> file2
Simple way to empty a file or make an empty file (bash or
ksh) do:
> file
On Sun, 8 Aug 2004, Aroop MP wrote:
> How can i attach one file on the top of another file.
>
> Suppose file1 has 10 lines and file2 has 20 lines. I want to attach the 10
> lines of file1 to file2 so that the file2 will have 30 lines in total.
>
> On Sunday 08 Aug 2004 5:31 pm, Sascha Retzki wrote:
> > Am So, 2004-08-08 um 13.44 schrieb Roberto Vanto:
> > > Anindya Mozumdar ha scritto:
> > > > Hi,
> > > > How can I make a file zero length without deleting the contents of
> > > > the file manually through an editor ?
> > > > Anindya.
> > > > -
> > >
> > > man touch
> > >
> > > touch foo
> >
> > touch changes the timestamp if the file exists. It sounds like the file
> > already exists. btw, You don't need to delete it through an editor, "rm
> > foo ; touch foo" would do it, too. ;-)
> >
--
John Julian
Computer Geek
cell: 248-787-2221
pager: 800-621-4951
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: File size
2004-08-08 9:00 File size Anindya Mozumdar
2004-08-08 9:16 ` Sascha Retzki
2004-08-08 11:44 ` Roberto Vanto
@ 2004-08-08 12:44 ` Tim Walberg
2004-08-08 15:45 ` (unknown) Debian UserJens Suelwald
` (4 subsequent siblings)
7 siblings, 0 replies; 17+ messages in thread
From: Tim Walberg @ 2004-08-08 12:44 UTC (permalink / raw)
To: Anindya Mozumdar; +Cc: linux-admin
cp /dev/null somefile
On 08/08/2004 14:30 +0530, Anindya Mozumdar wrote:
>> Hi,
>> How can I make a file zero length without deleting the contents of
>> the file manually through an editor ?
>> Anindya.
>> -
>> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
End of included message
--
+--------------------------+------------------------------+
| Tim Walberg | twalberg@mindspring.com |
| 830 Carriage Dr. | www.mindspring.com/~twalberg |
| Algonquin, IL 60102 | |
+--------------------------+------------------------------+
^ permalink raw reply [flat|nested] 17+ messages in thread* (unknown)
2004-08-08 9:00 File size Anindya Mozumdar
` (2 preceding siblings ...)
2004-08-08 12:44 ` Tim Walberg
@ 2004-08-08 15:45 ` Debian UserJens Suelwald
2004-08-09 13:21 ` Adam Lang
2004-08-09 8:41 ` File size Ag. System Administrator
` (3 subsequent siblings)
7 siblings, 1 reply; 17+ messages in thread
From: Debian UserJens Suelwald @ 2004-08-08 15:45 UTC (permalink / raw)
Cc: linux-admin
unsubscribe linux-admin
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: File size
2004-08-08 9:00 File size Anindya Mozumdar
` (3 preceding siblings ...)
2004-08-08 15:45 ` (unknown) Debian UserJens Suelwald
@ 2004-08-09 8:41 ` Ag. System Administrator
2004-08-09 14:39 ` Scott Taylor
` (2 subsequent siblings)
7 siblings, 0 replies; 17+ messages in thread
From: Ag. System Administrator @ 2004-08-09 8:41 UTC (permalink / raw)
To: linux-admin
Anindya Mozumdar wrote:
> Hi,
> How can I make a file zero length without deleting the contents of
> the file manually through an editor ?
> Anindya.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
do that from cmd line:
> /file
Adios,
D
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: File size
2004-08-08 9:00 File size Anindya Mozumdar
` (4 preceding siblings ...)
2004-08-09 8:41 ` File size Ag. System Administrator
@ 2004-08-09 14:39 ` Scott Taylor
2004-08-10 6:27 ` Andrew Kelly
2004-08-10 13:47 ` Anindya Mozumdar
7 siblings, 0 replies; 17+ messages in thread
From: Scott Taylor @ 2004-08-09 14:39 UTC (permalink / raw)
To: linux-admin
Anindya Mozumdar said:
> Hi,
> How can I make a file zero length without deleting the contents of
> the file manually through an editor ?
LMAO
If you are trying to get answers to a test or have us do your home work
for you, this is probably not the best place to do it. Here you will find
SysAdmins, not all are schooled and many times you will find answers here
that do not agree with your school book.
For stuff like this you should try linux-newbie@vger.kernel.org
Although, you may find a lot of bored SysAdmins here, giving you all kinds
of strange answers (some that are even wrong), this is not the appropriate
place. As funny as it is, people should not give wrong answers, and less
then knowlegdeable SysAdmins should not either.
BTW, "cp /dev/null > myFile" works, but may need to be contested to give
you accurate points on a test. Depending on your shell, probably, a
simple ">myFile" will be the proper response.
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: File size
2004-08-08 9:00 File size Anindya Mozumdar
` (5 preceding siblings ...)
2004-08-09 14:39 ` Scott Taylor
@ 2004-08-10 6:27 ` Andrew Kelly
2004-08-10 13:47 ` Anindya Mozumdar
7 siblings, 0 replies; 17+ messages in thread
From: Andrew Kelly @ 2004-08-10 6:27 UTC (permalink / raw)
To: Anindya Mozumdar; +Cc: linux-admin@vger.kernel.org
On Sun, 2004-08-08 at 11:00, Anindya Mozumdar wrote:
> Hi,
> How can I make a file zero length without deleting the contents of
> the file manually through an editor ?
One more voice in the crowd...
:>foo
After we've helped you with your homework, do we get to put our hand up
your sweater?
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: File size
2004-08-08 9:00 File size Anindya Mozumdar
` (6 preceding siblings ...)
2004-08-10 6:27 ` Andrew Kelly
@ 2004-08-10 13:47 ` Anindya Mozumdar
7 siblings, 0 replies; 17+ messages in thread
From: Anindya Mozumdar @ 2004-08-10 13:47 UTC (permalink / raw)
To: linux-admin
Hi,
Thanks very much for your replies. However, this was not any homework
or assignment. This arose mainly from an argument regarding touch with
a fellow linux user, and since we did not have access to any machine
running linux, the best solution was this mail.
In fact, someone did give a wrong solution with touch, which was
precisely the point of argument. The mail was sent in the form below
so that we can get to know the other unnoticed ways, hoping that someone
mentions touch as a solution.
Anindya.
On Sun, Aug 08, 2004 at 02:30:45PM +0530, Anindya Mozumdar wrote:
> Hi,
> How can I make a file zero length without deleting the contents of
> the file manually through an editor ?
> Anindya.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 17+ messages in thread