Skip to main content

All Questions

Tagged with
0 votes
1 answer
45 views

cpulimit: detect failure / exit status in Linux

I'm using cpulimit in a Bash script to run a certain command (ffmpeg) with a limited CPU usage, but I want to know if the command fails. But when the command(ffmpeg) fails with any error, cpulimit ...
saeedgnu's user avatar
  • 153
-2 votes
1 answer
78 views

CSV file with many columns, print each using loop [closed]

I have a CSV file saved on my desktop with many columns. The CSV file has only one row but 195 columns and I have to print each column in Unix using loop command. The path of the file is /home/...
Kinjal Sinha's user avatar
0 votes
1 answer
59 views

Find file in directories of PATH env which match partially

Idea is to match a filename in any of directories mentioned in PATH environment. Usually, we do this by running "which <executable_filename>". This works fine, when the file your are ...
Sachin's user avatar
  • 3
5 votes
2 answers
994 views

How to execute command after every failed command?

I am trying to log every time a command fails (by sending an HTTP request to my VPS) to see how many times I have messed up. I've tried: some_command || curl <my-vps>. Is there a better way?
TheHolyTachanka's user avatar
3 votes
0 answers
226 views

I want to hide the output when I type in the make command in the terminal

So I'm on Linux and I've been tinkering around with cs50. I've figured out a way to emulate the make command that is used in the course. When I type this make command, a line will print that I would ...
JackChan20's user avatar
-1 votes
1 answer
1k views

How can I delete a file with spaces and quotes in the name?

How do I delete a file named 1 '2 3' 4 5 in Linux? None of the methods I've used have worked.
Oluchi's user avatar
  • 15
0 votes
1 answer
1k views

How to Rename middle part of multiple files [duplicate]

I have some numeric files like: test01-aaa.txt test02-bbb.txt test03-ccc.txt test04-ddd.txt I need to remove aaa,bbb,ccc,ddd part from the name. what is the best way i can do? I tried with 'rename' ...
Sepehr roosta's user avatar
0 votes
1 answer
410 views

EtherCAT not found after full installation

I have been trying for the past few days to get the EtherCAT working with LinuxCNC, but my lack of knowledge about the Linux environment does not allow me to even start the project. I have all the ...
Omid_Mirzaee_Yazdi's user avatar
1 vote
1 answer
373 views

Ensuring only 1 mandatory parameter is passed to script

I am writing a shell script and new to getopts for parameter parsing. What I have are 1 optional and 2 mandatory parameters and what I want to do is ensure that only one mandatory parameter is passed. ...
aika's user avatar
  • 13
1 vote
1 answer
1k views

Wha't is the meaning of global option in dig command and how to use them?

dig mt-example.com ; <<>> DiG 9.4.1-P1 <<>> mt-example.com ;; global options: printcmd I wonder what's the global options and what printcmd meaning, I searched in internet ...
user956609's user avatar
2 votes
1 answer
4k views

How to uncompress multiple Zlib Archives with one comand

I have >200 .zlib Archives and I want to uncompress them using one command in Linux console. I just cant get the command right. maybe somone can help me: for z in *.zlib; do; zlib-flate -uncompress ...
jonasbsv's user avatar
1 vote
1 answer
210 views

Collect every n lines from a file

I have a huge log file, which needs to be streamed over HTTP. For performance reason, I want to capture/collect every n lines and send it over. So, basically, what I want is n lines buffered output ...
ashokgelal's user avatar
-1 votes
1 answer
805 views

How to get certain words in /proc/cpuinfo

I use a command like this: test@localhost:~> cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 23 model : 1 model name : AMD Ryzen 5 1600 Six-...
bbdd's user avatar
  • 101
0 votes
2 answers
135 views

Edit script to email output?

I'm basically trying to put two scripts I found online together. The first, in two parts, checks if a directory exists, if not creates it then goes on to take a picture through the webcam if an ...
caticora's user avatar
0 votes
2 answers
3k views

How can i store commands as a variables and execute them randomly in bash?

How can i store commands as a variables and execute them randomly in bash? command1=" convert -size 2000x1000 xc:none -gravity center \ -stroke yellow -pointsize 50 -font Courier-BoldOblique -...
Madhubala's user avatar
  • 304

15 30 50 per page