Size of file /dev/./null 2>&1


 
Thread Tools Search this Thread
Operating Systems AIX Size of file /dev/./null 2>&1
# 1  
Old 08-11-2015
Size of file /dev/./null 2>&1

Hello

Can I just remove/delete flile ?
Code:
 rw-r--r--    1 root     system   2385088512 Jun 30 21:25 /dev/null 2>&1

size of this flile is 2274.75 m and fill up my filesystem:
Code:
Filesystem    MB blocks      Used      Free %Used Mounted on
/dev/hd4        2560.00   2558.59      1.41  100% /

# 2  
Old 08-11-2015
if you go in /dev and type this command:
Code:
 ls -l n*

what do you get?
# 3  
Old 08-11-2015
this:
Code:
crw-rw-rw-    1 root     system        2,  2 Aug 11 15:43 null
-rw-r--r--    1 root     system   2385088512 Jun 30 21:25 null 2>&1
crw-rw-rw-    1 root     system       18, 32 Aug 08 2012  nuls
crw-r--r-T    1 root     system        3,  0 Aug 08 2012  nvram

# 4  
Old 08-11-2015
So yes you can remove but be aware how... maybe something like
Code:
rm null*1

but in any case not
Code:
rm  null 2>&1

This User Gave Thanks to vbe For This Post:
# 5  
Old 08-11-2015
Thanks vbe
It works

ps.
I could remove "null 2>&1" becouse in /dev exist another file "null" !?
# 6  
Old 08-11-2015
Its almost that... what do you think your shell would understand? for sure as you have a space I dont know how it could have happened, looks to me like someone is testing your capabilities...
I believe if I typed
Code:
touch null 2&>1

I would have ended with2-3 files : null, 2 and maybe 1
So I doubt it being a typo but still could be a very unlucky case
ADDENDUM:
In my aix in /dev I have
Code:
n12:/home/vbe $ ll /dev/n*
brw-------    1 root     system       33, 18 Aug 10 11:45 /dev/nsmb0
crw-rw-rw-    1 root     system        2,  2 Aug 11 16:00 /dev/null
crw-rw-rw-    1 root     system       12, 24 Jun 24 15:15 /dev/nuls
crw-r--r-T    1 root     system        3,  0 Jun 24 15:15 /dev/nvram

As you can see, these files are not ordinary files the listing starts by b or c meaning block a char devices... In your output you see:
Code:
crw-rw-rw-    1 root     system        2,  2 Aug 11 15:43 null
-rw-r--r--    1 root     system   2385088512 Jun 30 21:25 null 2>&1
crw-rw-rw-    1 root     system       18, 32 Aug 08 2012  nuls
crw-r--r-T    1 root     system        3,  0 Aug 08 2012  nvram

where
Code:
-rw-r--r--    1 root     system   2385088512 Jun 30 21:25 null 2>&1

is defilinely a standard file only its name makes it more tricky to delete...

Last edited by vbe; 08-11-2015 at 11:17 AM..
# 7  
Old 08-11-2015
As VBE already stated, i'd guess as well to be something like lots of:
Code:
echo "string" >> '/dev/null 2>&1'

instead of:
Code:
echo "string" >> /dev/null 2&>1

And, obviously, executed as root.

My understanding issue is a different one...
Wouldnt this redirect the regular output to /dev/null, and error message to stdout, which is quite 'ambigious' (missing better word) and could be ignored, since stderr usualy passes general redirection anyway.

Anyway, hope this helps
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Housekeeping null 2>&1 in /dev

Hello, Does anyone know how to housekeeping the null 2>&1 file in /dev? its fill up my system, please help. Thanks :b: (3 Replies)
Discussion started by: only
3 Replies

2. Shell Programming and Scripting

Redirecting standard out to /dev/null goes to file "/dev/null" instead

I apologize if this question has been answered else where or is too elementary. I ran across a KSH script (long unimportant story) that does this: if ; then CAS_SRC_LOG="/var/log/cas_src.log 2>&1" else CAS_SRC_LOG="/dev/null 2>&1" fithen does this: /usr/bin/echo "heartbeat:... (5 Replies)
Discussion started by: jbmorrisonjr
5 Replies

3. UNIX for Dummies Questions & Answers

/dev/null a file using xargs

Hi, I'm currently using the following command to wipe clean a log file which can't be straight out RM'd: cat /dev/null > server.log I'm building this into a script and I'm current working on a command to run on each machine to do this automatically however I have multiple files so I need... (11 Replies)
Discussion started by: Deehem
11 Replies

4. UNIX for Dummies Questions & Answers

/dev/null 2>&1 Versus /dev/null 2>1

How are these two different? They both prevent output and error from being displayed. I don't see the use of the "&" echo "hello" > /dev/null 2>&1 echo "hello" > /dev/null 2>1 (3 Replies)
Discussion started by: glev2005
3 Replies

5. Shell Programming and Scripting

Difference between ">/dev/null 2>&1" and "2>&1 >/dev/null"

Does >/dev/null 2>&1 and 2>&1 >/dev/null mean the same? (4 Replies)
Discussion started by: proactiveaditya
4 Replies

6. Shell Programming and Scripting

Meaning of "> /dev/null 2>&1"

Hi, I am new into UNIX shell scripting and I am wondering what is the meaning of the below text which appears at the end of each line in the ".sh" file: > /dev/null 2>&1 For example, the line below: sh $HOME/stats/Rep777/Act_777.sh omc omc > /dev/null 2>&1 I know for sure what "sh... (10 Replies)
Discussion started by: salanalani
10 Replies

7. Solaris

What is /dev/tty /dev/null and /dev/console

Hi, Anyone can help My solaris 8 system has the following /dev/null , /dev/tty and /dev/console All permission are lrwxrwxrwx Can this be change to a non-world write ?? any impact ?? (12 Replies)
Discussion started by: civic2005
12 Replies

8. UNIX for Advanced & Expert Users

/dev/NULL can't open this file ??

when i write the following two statements : cp /dev/NULL /clocal/mqbrkrs/user/mqsiadm/sanjay/dspmq_temp cat /dev/NULL > /clocal/mqbrkrs/user/mqsiadm/sanjay/dspmq_temp its gives me errors like : cp: /dev/NULL: A file or directory in the path name does not exist. cat : /dev/NULL can't open... (2 Replies)
Discussion started by: varungupta
2 Replies

9. UNIX for Dummies Questions & Answers

Creating a file / /dev/null

First of all, hello there cOmMuNity ! :cool: Well, I've got two basic questions: 1) In how many ways it's possible to create a file ? I know one manner using "touch", other typing something like echo "" > file ... The fact is that I need to overwrite the file if it exists, and touch... (8 Replies)
Discussion started by: 435 Gavea
8 Replies

10. UNIX for Dummies Questions & Answers

/dev/null 2>&1 question

Hi, suppose you have the following line at your crontab : 5 * * * * /usr/mine/script > /dev/null 2>&1 now i understood that the " > /dev/null 2>&1 outputs both Standard outpout and Standard Error messages to the /dev/null device or file... the first part , " > /dev/null " transfers... (1 Reply)
Discussion started by: BAM
1 Replies
Login or Register to Ask a Question