Questions tagged [write]

87 questions
64
votes
3 answers

How does `yes` write to file so quickly?

Let me give an example: $ timeout 1 yes "GNU" > file1 $ wc -l file1 11504640 file1 $ for ((sec0=`date +%S`;sec<=$(($sec0+5));sec=`date +%S`)); do echo "GNU" >> file2; done $ wc -l file2 1953 file2 Here you can see that the command yes writes…
Pandya
  • 23,898
  • 29
  • 92
  • 144
43
votes
1 answer

How to get total read and total write IOPS in Linux?

How do I get read and write IOPS separately in Linux, using command line or in a programmatic way? I have installed sysstat package. Please tell me how do I calculate these separately using sysstat package commands. Or, is it possible to calculate…
shas
  • 2,578
  • 4
  • 17
  • 31
14
votes
4 answers

Sending message from one terminal user to another user

I have a user of name x in tty1 and y in tty2. Now x wants to write some message to y and vice-versa. Now I typed in tty1 terminal write y tty2 It is showing write:write:you have write permission turned off write:y has messages disabled Same thing…
saptarshi nag
  • 275
  • 1
  • 3
  • 11
9
votes
4 answers

Overwriting a running executable or .so

I have a question about overwriting a running executable, or overwriting a shared library (.so) file that's in use by one or more running programs. Back in the day, for the obvious reasons, overwriting a running executable didn't work. There's even…
Steve Summit
  • 507
  • 3
  • 12
8
votes
3 answers

How can I output a command to a file, without getting a blank file on error?

I'm trying to run a command, write that to a file, and then I'm using that file for something else. The gist of what I need is: myAPICommand.exe parameters > myFile.txt The problem is that myAPICommand.exe fails a lot. I attempt to fix some of the…
goodguy5
  • 194
  • 1
  • 9
6
votes
1 answer

Atomically write a file without changing inodes (preserve hard link)

The normal way to safely, atomically write a file X on Unix is: Write the new file contents to a temporary file Y. rename(2) Y to X In two steps it appears that we have done nothing but change X "in-place". It is protected against race conditions…
cat
  • 3,428
  • 4
  • 22
  • 50
6
votes
1 answer

Why can't I send messages with the wall command?

I'm trying to send messages with either wall or write. To test this, I opened two gnome-terminal windows. Then entered the following in one window: me@host>>wall message to everyone + d When I finished the message I sent an interrupt…
ichbinallen
  • 313
  • 2
  • 4
  • 9
5
votes
2 answers

How to determine whether the data is written to disk or cached?

I'm learning file operation calls under Linux. The read() and write() and many other functions use cache to increase performance, and I know fsync() can transfer data from cache to disk device. However, is there any commands or system calls that…
Krist Pan
  • 105
  • 4
4
votes
1 answer

Why rm gives warning when deleting a write protected file?

I have a regular file and I changed its permission to 444. I understand that as the file is write protected, we can't modify or remove the contents of file but when I try to remove this file using rm, it generates a warning stating whether I want to…
LocalHost
  • 469
  • 3
  • 10
  • 20
4
votes
1 answer

How to force Fedora 27 to write to USB flash drive immediately?

My Fedora 27 writes actual data to USB on umount. Before umount it works only with links or something like that. So, for example, when I transfer a big file of 5 GB cp /home/iam/bigFile /run/mnt/iam/myUSB/ it will be transferred in several seconds.…
Oleksandr
  • 999
  • 4
  • 13
  • 22
4
votes
1 answer

Linux USB Flash direct write / write cache

Lately I've been using USB2 flash drives to transfer a lot of data to my company. When copying the Data to the flash drive, I noticed that the data is not written directly to the drive. It wrote with 200MB/sec to cache(?). I then umount or sync the…
Gerald Zehetner
  • 141
  • 1
  • 5
3
votes
0 answers

Minimizing disk usage with parallel calls to GCC

I am experimenting with testing GCC in parallel. My setup will run 96 tests before giving me the test report. If I run these tests sequentially it will invoke GCC once, run the executable, gather diagnostics and then repeat. However, when I try to…
Rewbert
  • 131
  • 3
3
votes
2 answers

How do I feed data to a pipe until it's full, no more no less?

I want to use pipes on Linux as a synchronization primitive between a master process and a slave process. The classic way is to create two pipes, but I believe there's a way to use a single fd instead. Consider: The slave creates r-w pipe. Read end…
Ivanq
  • 41
  • 5
3
votes
1 answer

How to use write command to send message to user in debian stretch

who command show that xyz user is on tty2. $ who xyz tty2 2018-06-22 08:18 (:0) I trying send message to xyz using write xyz command. But it does not shows on terminal. When I run tty command on xyz user terminal. $ tty /dev/pts/1 but…
3
votes
1 answer

What data transfer / write speeds are to be expected for a badblock destructible write test?

I have purchased a new HDD for my backups. Before entrusting the device with the job of keeping my data safe I want to make sure that it is in good condition. The drive is a new internal 3.5 inch SATA drive. I started a destructive write test with…
norritt
  • 85
  • 1
  • 6
1
2 3 4 5 6