Hot answers tagged

20

On a GNU system and if you have pv, you could do: cmd=' that command | to execute && as shell code' yes | pv -qL10 | xargs -n1 -P20 sh -c "$cmd" sh The -P20 is to execute at most 20 $cmd at the same time. -L10 limits the rate to 10 bytes per second, so 5 lines per second. If your $cmds become two slow and causes the 20 limit to be ...


7

The ~ is part of the filename: ls *.py~ Thus, to delete all such files: rm *~


5

Just use sed p. echo foobar | sed p You don't need cat, either: sed p input.txt # or sed p input.txt > output.txt Explanation p is the sed command for "print." Print is also sed's default action. So when you tell sed explicitly to print, the result is that it prints every line twice. Let's say you wanted to only print lines that include the ...


3

Simplistically, if your command lasts less than 1 second you can just start 5 commands each second. Obviously, this is very bursty. while sleep 1 do for i in {1..5} do mycmd & done done If your command might take more than 1 second and you want to spread out the commands you can try while : do for i in {0..4} do sleep ...


3

That happened because the output you produced included codes that your terminal interface interpreted as control codes. This is normally resolved with either reset or stty sane.


2

Another common remedy for this problem is to type Ctrl-VCtrl-O at the shell prompt. The first puts the shell into "literal" mode so that it won't modify the following character, which is the terminal reset command understood by almost all common terminal types. You might need to echo this instead, on some terminals.


2

You can use screen multiplexer such tmux. It is available via apt-get on ubuntu machines


2

You can use the commande file e,g: file images.jpg the output is something like : images.jpg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 342x147, frames 3 OR rdjpgcom -verbose images.jpg sample output JPEG image is 342w * 147h, 3 color components, 8 bits per sample JPEG process: ...


2

It looks as though some of your commands have been modified/removed outside of yum. You need to reinstall the missing commands like so: yum reinstall which You can give multiple packages as you identify them: yum reinstall which clear If you find that lots of commands have been removed, it may be easier to reinstall your whole system.


2

I was able to solve this problem by following commands : mv /var/lib/dpkg/info/coturn.* /tmp/ dpkg --remove --force-remove-reinstreq coturn This worked. And I installed coturn again, then it worked.


2

In KDE the reference CD burning software is K3b, which is packaged in Debian as k3b. On the command-line you'd probably use cdrkit (the main package is called wodim).


1

For basic burning, Debian has at least the following tools, wodim -v dev=/dev/sr0 -dao /home/user/file.iso cdrskin -v dev=/dev/sr0 -dao /home/user/file.iso xorriso -as cdrecord -v dev=/dev/sr0 -dao /home/user/file.iso I don't know if they support all the features you require. You can get more details from the Debian site.


1

Using node.js you can start a single thread that executes the bash script every 200 milliseconds no matter how long the response takes to come back because the response comes throug a callback function. var util = require('util') exec = require('child_process').exec setInterval(function(){ child = exec('fullpath to bash script', ...


1

With a C program, You can for example use a thread which sleeps for 0.2 seconds into a while #include<stdio.h> #include<string.h> #include<pthread.h> #include<stdlib.h> #include<unistd.h> pthread_t tid; void* doSomeThing() { While(1){ //execute my command sleep(0.2) } } int main(void) { int ...


1

The two main reasons to run a program directly without calling the shell are: Performance: Most programs that you would call from your C program are likely much smaller than the shell, which makes them start much more quickly. Environment control: Dealing with an additional layer of environment variables to deal with can be more complex to configure and ...



Only top voted, non community-wiki answers of a minimum length are eligible