Questions tagged [buffer]

This tag is for questions about kernel buffer caches, including pipe buffers. These are used to store the recently accessed files and/or frequently accessed files.

Frequently Asked Questions:

172 questions
523
votes
15 answers

Turn off buffering in pipe

I have a script which calls two commands: long_running_command | print_progress The long_running_command prints progress but I'm unhappy with it. I'm using print_progress to make it nicer (namely, I print the progress in a single line). The…
Aaron Digulla
  • 5,918
  • 4
  • 19
  • 17
181
votes
7 answers

How big is the pipe buffer?

As a comment in I'm confused as to why "| true" in a makefile has the same effect as "|| true" user cjm wrote: Another reason to avoid | true is that if the command produced enough output to fill up the pipe buffer, it would block waiting for true…
Kit Sunde
  • 4,394
  • 10
  • 30
  • 34
172
votes
16 answers

How can I do a 'change word' in Vim using the current paste buffer?

I have some text in my paste buffer, e.g. I did a yw (yank word) and now I have 'foo' in my buffer. I now go to the word 'bar', and I want to replace it with my paste buffer. To replace the text manually I could do cw and then type the new word. How…
Michael Durrant
  • 41,213
  • 69
  • 165
  • 232
52
votes
6 answers

Restrict size of buffer cache in Linux

Is there a way to tell the Linux kernel to only use a certain percentage of memory for the buffer cache? I know /proc/sys/vm/drop_caches can be used to clear the cache temporarily, but is there any permanent setting that prevents it from growing to…
Wim
  • 573
  • 1
  • 5
  • 7
44
votes
4 answers

How to change the name of a vim buffer

Is it possible to change the name of a buffer in vim? Specifically, I'm using Conque Shell to open shells in vim (each shell is in a buffer) and with multiple shells, I see: 10: bash - 1 11: bash - 2 in my buffer list. I would like to rename these…
Barthelemy
  • 5,085
  • 3
  • 23
  • 18
34
votes
1 answer

What exactly is scrollback and scrollback buffer?

What are "scrollback" and "scrollback buffer" in programs like bash and screen, and how do they relate to the tty, the programs being run, and stdin/ stdout/ stderr? Here is the only definition of "scrollback" I found so far (in the archlinux…
Oleg Pryadko
  • 2,330
  • 7
  • 25
  • 33
33
votes
3 answers

Is there truth to the philosophy that you should sync; sync; sync; sync?

When I was first introduced to Linux, working at Cisco Systems in 2000, I was taught the merits of the sync command, used to flush buffers to disk to prevent filesystem corruption / data loss. I was told not only by coworkers there, but by friends…
Josh
  • 8,311
  • 12
  • 54
  • 73
23
votes
2 answers

Pipes, how do data flow in a pipeline?

I don't understand how the data flows in the pipeline and hope someone could clarify what is going on there. I thought a pipeline of commands processes files (text, arrays of strings) in line by line manner. (If each command itself works line by…
xealits
  • 2,093
  • 3
  • 19
  • 27
21
votes
3 answers

Prevent unwanted buffers from opening

I'm using emacs for my daily javascript editing, to switch between buffers I use C-x LEFT and C-x RIGHT and I'm fine with this (even if I find it difficult to know the path of the file I'm modifying). My problems: at the startup I always have…
20
votes
1 answer

Buffer size for capturing packets in kernel space?

Going through the man page of tcpdump, it seems kernel can drop the packets if the buffer is full. I was wondering if: that size is configurable and/or where can I see the size for my distro? From the man page (for easy reference): packets…
Anon
  • 201
  • 1
  • 2
  • 3
18
votes
6 answers

Is there a way to sync only one partition?

Is there a way to sync only one partition instead of all partitions? Something like "sync /dev/sdc1".
HandyGandy
  • 2,201
  • 3
  • 23
  • 30
17
votes
1 answer

`unbuffer` or `stdbuf` for removing stdout buffering?

Is there a difference between unbuffer(1) and stdbuf(1)? From what I gather, unbuffer makes more than the "best effort" of calling the libc function set(X)buf at the beginning, and then letting things be?
dan3
  • 660
  • 6
  • 16
17
votes
5 answers

Completely buffer command output before piping to another command?

Is there a way to only execute a command after another is done without a temp file? I have one longer running command and another command that formats the output and sends it to a HTTP server using curl. If i just execute commandA | commandB,…
Josef
  • 315
  • 1
  • 3
  • 13
16
votes
6 answers

Utility to buffer an unbounded amount of data in a pipeline?

Is there a utility that I can stick in a pipeline to decouple read and write speeds? $ producer | buf | consumer Basically, I want a utility buf that reads its input as fast as possible, storing it in memory so consumer can take its sweet time…
Doctor J
  • 661
  • 7
  • 9
15
votes
3 answers

What happens when a file that is 100% paged in to the page cache gets modified by another process

I know that when a page cache page is modified, it is marked dirty and requires a writeback, but what happens when: Scenario: The file /apps/EXE, which is an executable file, is paged in to the page cache completely (all of its pages are in…
Gregg Leventhal
  • 7,480
  • 19
  • 65
  • 100
1
2 3
11 12