Skip to content

Tag: linux

Count of files between 2 size in Linux

Hi I want to find count of file between 2 size (for example 1k and 2k) in linux, I found that the code return the count of exact size in a directory and it work fine: could anyone help me how I do find between 2 size? And is it possible that I find the count of Hiden file via

How to create a system-wide file lock?

I am trying to have a number of independent processes coordinate their writing to file using a system-wide lock (see here: Concurrent file accesses from different scripts python) The lock needs to span the whole system, because the processes are spawn independently and at different times. Here: System-wide mu…

Cron format for specific date and time, running once a year only

I have to schedule the cron to run at specified time. I have the command like below. But I could not understand how to run only once in a year at a specified date and time. My question is: what should the value for 5th field (Day of the Week) be? Time/date: Jan 2nd 06:30 AM – only once in

How to clear CPU cached owned by a process in Linux x86

I want to get the kernel APIs which can be used to flush/clear the CPU cache owned by a specific process. Answer There’s no such thing as “CPU cache owned by a process”. The CPU / memory controller manages the cache, not the OS. On some CPU architectures (I don’t know!) it might be pos…

Connect to Vehicle Using Telemetry on Linux

I am having problems with connection to vehicle. First, I could not connect to the vehicle even with USB (I used “/dev/ttyUSB0” connection string and got an error). Later I got it working with connection string ‘/dev/serial/by-id/usb-3D_Robotics_PX4_FMU_v2.x_0-if00’ and was able to sen…

Change some field separators in awk

I have a input file 1.txt and I want an output file: out.txt I want to replace the first two ‘:’ in 1.txt with ‘||o||’, but with the script I am using But it is not giving the expected output. Any help would be highly appreciated. Answer Following sed may also help you in same. Explana…

Using sysctl interface from kernel module

I am trying to access tcp_pacing_ss_ratio defined in tcp_input.c from a kernel module. The variable can be modified using the sysctl command in user space. It is however not exported and cannot be referenced directly from the module. What is the simplest way to access a sysctl entry from a kernel module? Answ…