Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

shell-script

Cron job to delete files older than 3 days

August 7, 2022 by Magenaut

I need to remove files older than 3 days with a cron job in 3 different directories. (these 3 directories are children of a parent directory /a/b/c/1 & /a/b/c/2 & /a/b/c/3) Can this be done with one line in the crontab?

Categories Q&A, Unix & Linux Tags cron, files, rm, shell-script, timestamps Leave a comment

Is there any book , Tutorial on very very advanced shell scripting

August 7, 2022 by Magenaut

I am looking for some tutorial where a simple script is written using very advanced methods so that i can learn more from Answers: Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you … Read more

Categories Q&A, Unix & Linux Tags bash, shell-script Leave a comment

Preserve directory structure when moving files using find

August 7, 2022 by Magenaut

I have created the following script that move old days files as defined from source directory to destination directory. It is working perfectly.

Categories Q&A, Unix & Linux Tags bash, find, rename, shell-script Leave a comment

How to efficiently generate large, uniformly distributed, random integers in bash?

August 7, 2022 by Magenaut

I have been wondering what would be the best way to get good randomness in bash, i.e., what would be a procedure to get a random positive integer between MIN and MAX such that

Categories Q&A, Unix & Linux Tags bash, command-line, shell-script Leave a comment

How does !! work in bash?

August 7, 2022 by Magenaut

Very useful when you forget a sudo at the beginning of your command, !! acts like an alias of the previous command. Example :

Categories Q&A, Unix & Linux Tags bash, command-history, shell-script Leave a comment

Why do these bash fork bombs work differently and what is the significance of & in it?

August 7, 2022 by Magenaut

I get how a normal fork bomb works, but I don’t really understand why the & at the end of the common bash fork bomb is required and why these scripts behave differently:

Categories Q&A, Unix & Linux Tags bash, fork, shell-script Leave a comment

Shell script throws a not found error when run from a sh file. But if entered manually the commands work

August 7, 2022 by Magenaut

I’m trying to use the following script to generate a sitemap for my website. When I run it as sh thsitemap.sh I get an error like this and creates an empty sitemap.xml file:

Categories Q&A, Unix & Linux Tags bash, shell, shell-script Leave a comment

How to measure time of program execution and store that inside a variable

August 7, 2022 by Magenaut

In order to find out how long certain operations within a Bash (v4+) script take, I would like to parse the output from the time command “separately” and (ultimately) capture it within a Bash variable (let VARNAME=...).

Categories Q&A, Unix & Linux Tags bash, shell-script, time Leave a comment

Calling multiple bash scripts and running them in parallel, not in sequence

August 7, 2022 by Magenaut

Suppose that I have three (or more) bash scripts: script1.sh, script2.sh, and script3.sh. I would like to call all three of these scripts and run them in parallel. One way to do this is to just execute the following commands:

Categories Q&A, Unix & Linux Tags background-process, bash, parallelism, shell-script Leave a comment

Simultaneously calculate multiple digests (md5, sha256)?

August 7, 2022 by Magenaut

Under the assumption that disk I/O and free RAM is a bottleneck (while CPU time is not the limitation), does a tool exist that can calculate multiple message digests at once?

Categories Q&A, Unix & Linux Tags hashsum, parallelism, shell-script Leave a comment
Older posts
Newer posts
← Previous Page1 … Page19 Page20 Page21 … Page24 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress