Skip to content
Advertisement

Tag: file

Redirecting pv output to file

I’m using the pv utility to asses the speed of log entries being added in a log file, like this: This outputs the addition speed and refreshes every 5 sec: Now, I would like to redirect the current value (“10”) to a file and refresh it every 5s. Not append it, just overwrite the previous value in the file. Any

mv: cannot overwrite directory with non-directory

Is it possible to get around this problem? I have a situation where I need to move some files to 1 directory below. problem is that the filename inside g/ directory is the same as the directory name and I receive the following error: Example: /home/user/data/doc/version/3766/297534 is a directory, inside there is a also a file named 297534 so I

check if file is open with lsof

I’m using linux mint 13 xfce and I have a file named wv.gold that I’m trying to check in bash if it’s open by any program (for instance, I opened it in sublime-text and gedit) In many forums people say that if I run lsof | grep filename I should get 0 if it’s open or 256(1) if it’s closed,

Change file owner group under Linux with java.nio.Files

I have a Linux server and I’m running an image resize job in Java for multiple websites on my server. The website files are owned by different OS users/groups. Newly created thumbnails/previews are owned by the user running the resize job. Now I was googleing around how to change the file owner of newly created previews/thumbnails in my resize program

How to clean a data file from binary junk?

I have this data file, which is supposed to be a normal ASCII file. However, it has some junk in the end of the first line. It only shows when I look at it with vi or less –> grep is also saying that it’s a binary file: Binary file data.dat matches This is causing some trouble in my parsing

Advertisement