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
2
votes
1 answer

using NUL dir on Windows messed up my Git

I had this code running in a Node.js codebase for awhile: if (os.platform() === 'win32') { stdout = fs.openSync('NUL', 'a'); it put a ghost file ('NUL') on my machine at the root of the project, and I can't git rm it or delete it permanently.…
Alexander Mills
  • 90,741
  • 139
  • 482
  • 817
2
votes
1 answer

How to use trap to terminate while loop containing ffmpeg fed by redirect from /dev/null?

I discovered here Loop calls process that takes a long time to complete. How do I break out of it? that piping from find to a while loop that calls an ffmpeg cli [HandBrakeCLI] will not process more than one input file because ffmpeg has a quirk…
Lorccan
  • 793
  • 5
  • 20
2
votes
2 answers

Why include /dev/null in makefile?

I ran across a line in a makefile. The line was: -include $(wildcard makefile.mk) /dev/null I don't understand the purpose of the /dev/null in the include line. Is it intentional or is it a mistake? Perhaps they intended to send the output there?…
greggmi
  • 445
  • 4
  • 14
1
vote
0 answers

How to Write Files to /dev/null in Powershell and CMD on Windows?

In CMD.exe I can copy files to /dev/null/ like this: copy foo.bar NUL But when type: rar.exe x fileToBeExtracted.rar NUL It will throw a error. In Powershell I can Not copy files to /dev/null/ like CMD: copy foo.bar NUL or Copy-Item foo.bar NUL or…
janjin
  • 33
  • 3
1
vote
0 answers

How does /dev/zero return a constant stream of zero?

I am trying to recreate what /dev/zero does. I got a /dev/null driver working more or less, but can not quite see how to implement zero. My main problem is with understanding the "read" part. The man page says: Reads from /dev/zero always return…
led
  • 56
  • 4
1
vote
0 answers

Make --output-sync can't redirect output to /dev/null

I build a binary file using command make -j8 --output-sync And it works fine, but when I try to redirect output to /dev/null it hangs forever. The command is: make -j8 --output-sync > /dev/null In case I set the option --output-sync=recurse not…
LeonFibuck
  • 336
  • 2
  • 12
1
vote
1 answer

How to suppress errors/outputs from a TCL thread?

I have created a thread : set t1 [thread::create] thread::send $t1 { proc myProc {command args} { exec {*}[auto_execok $command] {*}$args >& /dev/null } } And then tried to send an asynchronous command : thread::send -async $t1…
1
vote
1 answer

Discard MediaCodec output after encoding

I am using MediaCodec in a Camera2 app and I have a use case of testing it by running recording for a day. I want the encode the video but I want it to be discarded just as soon as it is done so no storage is used. Something like routing the…
1
vote
1 answer

Portable output to null stream in Fortran

I'd like to implement a verbosity level flag in a Fortran program in the following way. The code would use statements write (level1, *) 'This will be shown always' write (level2, *) 'This will be shown sometimes' and the streams level1, level2 and…
jacob
  • 1,535
  • 1
  • 11
  • 26
1
vote
1 answer

How to redirect stderr to /dev/null

I have the following code: #include #include #include #include #include #include #include #include void tokenize( const std::string& str, char delim,…
Tóth Attila
  • 149
  • 1
  • 1
  • 10
1
vote
1 answer

Redirect certain commands to /dev/null in psql

I need to silence the output of \x on in the command below: $ psql foo_db -c '\x on' -c 'SELECT * FROM bar' So instead of seeing this: Expanded display is on. -[ RECORD 1 ] foo | lorem ipsum bar | dolor baz | sit_amet I only see: -[ RECORD 1 ] foo…
leetbacoon
  • 1,111
  • 2
  • 9
  • 32
1
vote
0 answers

Do not-to-screen stdout and stderr take resources?

I have a Python program, it has lots of "print" statements that print stuff to output constantly. If I run the script using "nohup", and do not redirect the output to "/dev/null". After a long-time running, will be "hidden" output, which not shown…
I Wonder
  • 168
  • 1
  • 2
  • 9
1
vote
2 answers

Send terminal output of software to file or /dev/null

I'm working with a program called Velvet (what we call an assembler in bioinformatics). This software doesn't come with a silent or quiet mode option and I have a script that runs it several times causing it to saturate my terminal with text that…
MikeKatz45
  • 545
  • 5
  • 16
1
vote
1 answer

Bash: Silence a process put into background

If I run a application using the bash and I put it into the background via STRG+z bg command If now the process is printing to stdout the shell prints this output. This output is not interesting for me and I do not like my shell to be polluted…
schorsch312
  • 5,553
  • 5
  • 28
  • 57
1
vote
1 answer

Redirect memory leak error message in bash

I use espeak with mbrola in a small tea timer script: timer() { sleep $1 && espeak -v mb-en1 -a 200 "Alert, alert, alert, $2" &> /dev/null; } Unfortunately there seems to be a memory leak in mbrola; it does not stop it from working though. $…
John Alba
  • 265
  • 2
  • 4
  • 14