Re: /dev/null
From: Dave Saville (dave_at_no-spam-deezee.org)
Date: 05/31/04
- Next message: Fredrik Lundholm: "Re: HPDAT 40 driver for Intel Solaris 9"
- Previous message: Tej: "/dev/null"
- In reply to: Tej: "/dev/null"
- Next in thread: Richard L. Hamilton: "Re: /dev/null"
- Reply: Richard L. Hamilton: "Re: /dev/null"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 31 May 2004 08:54:50 +0100 (BST)
On 31 May 2004 00:08:01 -0700, Tej wrote:
>
>
>Hello All,
>
>Would applercaite if someone can tell me about /dev/null
>
>1) what is /dev/null
>2) Since rm also removes why we use /dev/null ?
>3) what will happen if we use 2> /dev/null ? , /dev/null 2>&1
>
>Can any one give some of exapmles of usage /dev/null ?
It is usually used to throw away output from a command.
foo >/dev/null
It can also be used to truncate an open file. Say you have a logging
process that runs for ever. The log file will grow and grow. Solution:
cp foo.log foo.log.bak
cat /dev/null > foo.log
foo does not know anyone is messing with his open files and the log
stays a manageable size.
Secondary to that, if you rm a huge open log file you still don't get
the space back, but the /dev/null trick does.
HTH
-- Regards Dave Saville NB Remove no-spam- for good email address
- Next message: Fredrik Lundholm: "Re: HPDAT 40 driver for Intel Solaris 9"
- Previous message: Tej: "/dev/null"
- In reply to: Tej: "/dev/null"
- Next in thread: Richard L. Hamilton: "Re: /dev/null"
- Reply: Richard L. Hamilton: "Re: /dev/null"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|