I am using html2text from Github in-which I was able to run-it on all the .html files in my folder using for file in *.html; do html2text “$file” > “$file.txt”; done but it’s some-what slow. How can I use html2text with parallel on all my .html files? Answer The original answe…
How to remove/modify syslogd message’s header?
I’m currently use the syslogd of busybox for logging some information. However, I’m unable to modify the message’s header. I log the message like this: And I got this output: I want to replace message’s header with epoch time format like this: Or is there any way to completely remove t…
Use environment vars with head
I need to use some vars in a script where I use tail and head, my script works when I type it in the terminal but when it is in a .sh file I get this error from the head command: The error comes from this pipe of my script: I tried using variables in another script where only declaring
linux command to delete the last column of csv
How can I write a linux command to delete the last column of tab-delimited csv? Example input aaa bbb ccc ddd 111 222 333 444 Expected output aaa bbb ccc 111 222 333 Answer It is easy to remove the fist field instead of the last. So we reverse the content, remove the first field, and then revers it again.
Yii2 call the console command not from the project folder
Hello. I created the console command in Yii2: I want to call this command in cron,and for testing I try to call it from the console, when I’m in the project folder: Everything works fine. But, if I call this command when I’m in a different directory, I get some errors. First, i got Seeing this, I …
How to use cron on a simple script
I want to use cron for execute a script periodically. I want to try a simple script first but it does not work. This is my script (scritp.sh) which permission are 700: And this is the crontab file when I edit it with the command crontab -e: EDIT: I have that script on /home/padro/Documents folder. What I do a…
How to sort or rearrange numbers from multiple column into multiple row [fixed into 4 columns]?
I have 1 text file, which is test1.txt. text1.txt contain as following: Input: Condition: A1 and B1 -> for each A1 + (B1 + [Tn + Vn]) A1 should be in 1 column. B1 should be in 1 column. T1,T2,T3 and T4 should be in 1 column. V1,V2,V3 and V4 should be in 1 column. How do I sort it
linux find files with optional character in their name
suppose I have two files: ac and abc. I want to find a regex to match both files. Normally I would expect the following regex to work, but it never does: I have tried escaping or not the questionmark, this never seems to work. Normally in the regex documentations I have found; ? means: previous character repe…
Fail event on mdadm
I received this error: This is an automatically generated mail message from mdadm running on host.xx.xx A Fail event had been detected on md device /dev/md2. It could be related to component device /dev/sda2. Faithfully yours, etc. P.S. The /proc/mdstat file currently contains the following: unused devices: T…
find and delete command in linux returning exit status 1 after deleting files
I am working on a linux script in which i have to delete the directories which are created before 7days. I have found a command which does the same. Below is the command But when i am checking the exit status of the command using echo $? it is returning 1 even after deleting the files from the location. To