Questions tagged [dev-null]

On Unix-like systems, /dev/null is a device file that discards all data written to it but reports that the write operation succeeded.

On Unix-like systems, /dev/null is a device file that discards all data written to it but reports that the write operation succeeded. It is typically used for disposing of unwanted output streams of a process, or as a convenient empty file for input streams.

69 questions
1
vote
2 answers

Significance of /dev/null in Web Servers?

Recently I've heard a bit about the implementation (or rather, use of) /dev/null in Mongrel2, as well as other projects. However, I've never seen it explained what this actually means. What does this mean, and why is it good for scalability (as I've…
elsurudo
  • 3,579
  • 2
  • 31
  • 48
1
vote
1 answer

Copy of /dev/null has different behaviours depending on location

I tried mimicking the behaviour of /dev/null in another location, but some strange error occurs. I learned how to generate a special file similar to /dev/null in -bash: /dev/null: Permission denied. When in some folder, e.g. home, the following…
Max Haslbeck
  • 151
  • 4
1
vote
2 answers

GTK: How to ignore "can't open display" errors?

I have written some GTK programs using the gtkD bindings for the D programming language that are otherwise console apps, but are capable of displaying plots on the screen and saving them to a file. I'd like to run these on a machine that I only…
dsimcha
  • 67,514
  • 53
  • 213
  • 334
1
vote
1 answer

mmap /dev/null for writing

Is it possible to mmap large amount of address space to /dev/null so all data written to it simply would be discarded? I need to perform disk/network reads but I don't need readed data (I know, it sounds a little weird) and there is a lot of…
user3489275
  • 401
  • 4
  • 8
0
votes
1 answer

What this unix command do 'who | grep “Milad” > /dev/null'?

I want to know what is this command do? In addition, the 'who | grep > /dev/null' in this loop why must return true or false: until who | grep “Milad” > /dev/null do sleep 60 done
softghost
  • 1,167
  • 1
  • 10
  • 16
0
votes
0 answers

Not able to run java code in the background using sh file

My SH file: #!/bin/bash DIR="$(dirname "$(readlink -f "$0")")/" cd "$DIR" javac -cp "streamer-client-java.jar:kafka-clients-3.4.0.jar:lz4-java-1.8.0.jar:slf4j-api-2.0.7.jar:snappy-java-1.1.10.0.jar:." EnduserCredentialExample.java java -cp…
0
votes
1 answer

lz4 redirect output to /dev/null

I have the following command in my bash script and want to redirect the output to /dev/null but it is not working. What is the right way to achieve this? tar cvf - -C / $SOURCE_DIR | lz4 --best - $ARCHIVE > /dev/null Edit: Example output (I'm…
0
votes
1 answer

Is dumping to FIFO has more overhead than to /dev/null?

I'm trying to solve a simple problem. I wish to start a long-running program in verbose mode, but I want to trash all of its output by default, and when some misbehavior occurs I wish to reattach the output to my terminal. The program itself is…
Daniel
  • 2,318
  • 2
  • 22
  • 53
0
votes
1 answer

bash output to /dev/null is 100x faster than stdout

The following simple program is 100x faster when directed to /dev/null: #include int main(int argc, char **argv) { for (int i=0;i<10000000;i++) { printf("%d\n",i); } return 0; } How can I find where exactly the speedup comes…
OrenIshShalom
  • 5,974
  • 9
  • 37
  • 87
0
votes
4 answers

If I call cat /dev/null twice in succession on a file, will the second call be a no-op?

I want to use cat filepath > /dev/null as a cheap memory caching mechanism. What I am wondering about is: if I call it a second time, and the file is already in the disk cache, is the OS smart enough to do nothing? Update: I've tested this on a CIFS…
Jacko
  • 12,665
  • 18
  • 75
  • 126
0
votes
1 answer

nohup command & : How to discard output?

I am running this command : nohup google-chrome > /dev/null 2>&1 & After I run it I get this output : [1] 16975 Is there anyway that I can run that command and get no output at all? Thanks in advance!
Smoke HHH
  • 83
  • 9
0
votes
0 answers

multiprocessing stuck showing No such file or directory '/dev/null'

I'm writing some code using multiprocessing in python, and running in docker debian stretch image, there are multiple containers running at the same time but only one is running these piece of code. The node of running this piece of code stuck for a…
0
votes
1 answer

Why does ioctl FIONREAD from /dev/null return 0 on Mac OS X and a random number on Linux?

I've come across something that seems strange while adding tests to a project I'm working on - I have been using /dev/null as a serial port and not expecting any data to be available for reading. However, on LINUX there is always data available,…
xlfe
  • 138
  • 2
  • 7
0
votes
2 answers

How to use a `with` statement to suppress `sys.stdout` or `sys.stderr`?

I'm trying to use a with statement to suppress sys.stdout or sys.stderr individually. I found a tutorial that didn't work. I'm using Python 3.6.4 and I think the tutorial is some version of Python 2. I looked it up on SO and found a few but with…
O.rka
  • 29,847
  • 68
  • 194
  • 309
0
votes
1 answer

Shell Script output piping in test does not work

I'm trying to control error output of a command parametrically but piping command is handled as another parameter. Test scripts below; ...$ cat printOutput.sh #!/bin/sh if [ $# -gt 0 ]; then echo "Wrong parameter $1"; exit; fi echo "stdout" echo…
HYK
  • 43
  • 6