Questions tagged [write]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
75 views

Alternatives to dd to read/write to a disk?

I'm using cp to read/write from an SSD drive but is not fast enough. Then I used dd, which is fast, especially with the drive unpartitioned. But I ran into errors like there is no space left on ...
0
votes
1answer
59 views

What is a replacement for devmem write in a bash script?

I can use the dd command to read a memory address (ex: 0x400): dd if=/dev/mem count=4 bs=1 skip=$(( 0x400 )) But how would I write a value to physical address (ex: 0x400)? I tried this: function ...
0
votes
1answer
320 views

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, ...
-1
votes
1answer
35 views

Why does the write speed keep changing, on a msdos file-system on toshiba 64Gb USB flashdrive

I have just bought a new 64gb toshiba 2.0usb flashdrive and put 13gb on it that took about 1 1/2 hours to transfer (max). But it started out saying about 7/8mb transfer and went to 1.3mb transfer, ...
0
votes
2answers
64 views

Can superuser write a file having 000 access permissions?

I know that a root user can read a file even if the access permissions are all set to 0 but i don't understand about the write and execute permissions in specific. Can a superuser write and execute a ...
0
votes
1answer
54 views

Notification 'Message Sent' for write command

I need to use the write command to send someone a message. Using a shell script if the message is sent successfully I want to have a 'Message sent!' notification pop up and if possible, end the shell ...
1
vote
1answer
49 views

How can I estimate the whole time of a write process including sync?

Progress and estimated time to write without and with sync I have found no tool (or straightforward method) that will include flushing the buffers when showing the progress and estimating the ...
1
vote
0answers
56 views

consistent writes to a file while preserving its inode

What is the best way to edit a file consistently (consistency used here in the database systems sense of the term) without changing its inode? Normally, I would write to a temporary file and then ...
0
votes
0answers
28 views

add commands for user in sudoers [duplicate]

I aware that root can add to sudoers pryvilege for user to run a specific command. Can I add to sudoers for example 'nano' to edit files restricted (rw) to root? or can I add 'cpan' to install modules ...
0
votes
0answers
52 views

when dirty page state is changed to clean?

When I study page cache and writeback(flush dirty pages to storage), the one question came up to me. When process makes too much dirty pages, writeback thread(background thread) will flush dirty pages ...
1
vote
1answer
37 views

write in file starting from certain line

I have a file which looks like this: ********************************** Some notes are here Year Month Day Hour Minute Second . . . . . . . . . . . . . . . . . Undertneath this, I would like to have ...
0
votes
0answers
22 views

Linux RedHat write buffer config

I have Linux RedHat 6.2. How do I configure files to buffer 4096 (or higher 2^N values) bytes before writes? Of course, when an EOF is received, write the file.
2
votes
1answer
100 views

Why does terminal takes input line by line?

If I use: strace echo 'a b c' > file The bottom lines are: write(1, "a\nb\nc\nd\n", 8) = 8 but in strace echo 'a b c d' > /dev/pts/0 These lines are: write(1, "a\n", 2) ...
0
votes
2answers
98 views

Save in a file first 7 file in the directory /bin that starts with c

I have write a command in the shell of linux to count the file (in total 8) starting with 'c'in the directory /bin find /bin/[c]* -type f | wc -l What I wish to do now, it's save the name of the ...
0
votes
2answers
53 views

Write command working one way?

I want to communicate with my girlfriend through the write command. She's on a mac, I am on a debian laptop. I did the next steps: adduser haly apt-get install openssh-server systemctl start ssh ...
6
votes
3answers
1k views

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 ...
4
votes
1answer
323 views

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 "...
0
votes
1answer
849 views

is `write()` asynchronous write?

From Operating System Concepts Another issue that can affect the performance of I/O is whether writes to the file system occur synchronously or asynchronously. Synchronous writes occur in ...
1
vote
1answer
65 views

Prevent Linux from writing to HDD

I have 3 HDD's, I want to install Linux Mint on HDD 3 which is currently empty and I don't want Linux to be able to write any data on the other 2 which is where all my Windows files are, is there a ...
0
votes
1answer
53 views

Why is my very old USB2 Harddisk faster than expected?

http://web1.heissa.de/usb2_speed.pdf From the spec, I would expect a max. write rate of 60 Mbyte/s. But today a simple test told me it‘s 226 MB/s. Is it possible that this is a trick of kernel 4,18 ...
0
votes
2answers
130 views

Split datetime column in csv file into MM/YYYY and time column separately and write to the same csv

I am trying to use awk, split and then print but running into error Input: id day userId itemId 1 12/1/17 8:32 2232 tv 2 1/12/18 10:18 3232 fdfs 3 2/9/18 10:50 232 fdsf ...
0
votes
1answer
767 views

Knowing when a write() on a serial port has finished transmitting data

I need to synchronize an IO pin value with a write to a serial port from user space (because I wasn't yet able to do it from kernel space - see my other question). My code (leaving out error checking) ...
1
vote
2answers
51 views

Can we use read(), write() on a directory in unix/linux?

Can we use read(), write() on a directory just like on any other file in Unix/Linux? I have a confusion here because directories are also considered as files.
0
votes
1answer
435 views

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

Prevent battery drain from constant write IO churn by browsers

For some reason, common browsers (Chromium is particularly bad, but Firefox isn't much better) generate constant IO load, particularly writes, on my Debian system. This is the case even when the ...
1
vote
1answer
610 views

Simulating slow down of disk operations

we know that there exist some excellent tool like netem which make it possible to slow down network parameters (like bandtwidth and so on). Is there exists analogous tool for simulating slow down ...
0
votes
1answer
70 views

Can reading STDIN conflict many writings from different processes? [closed]

One of my applications (Let's say "A") pushes its some alerts into STDIN and that app's shell script reads that STDIN and processes it. In the same way, there can be another applications (called B, C, ...
0
votes
1answer
135 views

Output to multiple files in crontab

In crontab I have set up a python script to run every 5 min, and output to a specific file */5 * * * * sudo /home/pi/MyProgram.py -o /home/pi/MyFile.csv How can I take the same ...
1
vote
1answer
2k views

How to block messages from write?

I have an ssh account on a server. Someone is spamming me with write messages. So I can't run any command in an interactive login. Is there anyway I can prevent them from sending me write messages or ...
4
votes
1answer
598 views

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/...
5
votes
4answers
2k views

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, ...
3
votes
1answer
934 views

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 ...
0
votes
1answer
65 views

Why is the write rate to the disk being up to several GB/s, while no process reports any writing?

I use Ubuntu 17.04, though this problem was persistent in many previous versions. Long ago (a year or two, I think) I started to spot it. Immediately (no more than a couple of minutes) after the ...
-2
votes
1answer
89 views

write/wall: how to prevent non-printable characters from being escaped [closed]

Compare dd if=/dev/urandom bs=512 count=4 to write lsr < <(dd if=/dev/urandom bs=512 count=4) How do I achieve the intended behaviour? Current output: Message from qwe@hhgw11 on pts/386 at ...
1
vote
0answers
102 views

Relation between write and filesystem blocksize in SSD disks on Apple

R. Stevens, in his famous book about programming in O.S. environment, taught us that when the syscall write's block size is comparable (or even equal) to the filesystem block size, the performances ...
-5
votes
1answer
71 views

Write xommand in Solaris, Unix

Hey guys need a little help here. For example me and my buddies are sending messages on our school computers using write user* pts/** , my question is can the system administrator see on his pc that ...
1
vote
0answers
28 views

Allowing write only access to a log? [duplicate]

I am in the process of putting in place an audit log, for operations related to database modifying operations and url access. For various reasons, including preventing tampering and protecting ...
2
votes
0answers
376 views

How to compress images using trimage?

I installed trimage to optimize images hosted on my websites with nginx However I'm getting the following error: [error] /var/www/resistfromday1.org/htdocs/wp-content/uploads/2017/01/video-anti-...
2
votes
1answer
174 views

Why doesn't /proc/self/fd/0 have a writable bit in serial session before a shell is started?

I came across a program which uses a very old version of linenoise library. All write() are done to STDIN_FILENO, like this: write(STDIN_FILENO,prompt,plen) write fails with -1 and errno set to ...
0
votes
1answer
2k views

Writing the output of a command to a file in a bash script

I am trying to write a simple bash script that executes the command tcprobe -i $1 where $1 is an mp4 file. Then, I want to write the output of this command, which should be a long string of ...
-2
votes
1answer
29 views

Loop until find entry and then use the entry

Lets say i have a file which have entries, File: user pts/1 2016-10-22 19:47 (ip) user1 pts/2 2016-10-22 20:04 (ip) user1 pts/3 2016-10-22 20:04 (ip) i want to have a loop ...
2
votes
1answer
5k views

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 <ctrl&...
1
vote
0answers
540 views

How to allow OpenLDAP user to write data to SSHFS mount point?

I mounted a network drive (Storage Server) to the directory /home/ldap for all OpenLDAP client computers. If a user login one of the computers, their home directory will be set the mount point as: /...
1
vote
2answers
2k views

How to write text containing $var to a bash file? [duplicate]

I am having trouble with writing case $1 in a bash file. I tried with cat <<EOT > /etc/init.d/startup.sh #!/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin case "$1" in start) ...
1
vote
0answers
849 views

RAID0 worse that write speeds of hard drives independently

So I have two hard drives one connect with SATA and one with USB3.0 SATA (/dev/sdc1): Apple HDD Toshiba USB (/dev/sde2): Western Digital Technologies, Inc. Elements SE Portable mounted ...
1
vote
0answers
306 views

Random write on DISK benchmark shows high read rate on iostat

I am running a random write benchmark directly on some disks (HDD & SDD) and I am getting some weird output data on the iostat monitor. Besides the usual write rate, there is a read rate that I ...
58
votes
3answers
8k views

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 ...
1
vote
2answers
681 views

No output when running script on startup (but correct output if run manually)

I recently got myself a Raspberry Pi 2 to learn a couple of things in my spare time. It is now running on Raspbian and I control it remotely via ssh from a laptop with Linux Mint 17.2 installed. Now ...
2
votes
1answer
206 views

How to write a luit command that outputs a file

I need to format a luit command so I can write a file that I'm trying to fix the encoding for. What I have right now is luit -encoding gbk cat santi.txt, but I would like this to have the output ...
1
vote
2answers
2k views

Stress (write) Test an SD card to destruction using a simple shell script

I would like to find out how many write cycles I can get from my SD card. I have googled and found good answers like this but its too complicated for a normal person like me. Say its a 64GB exfat ...