Skip to content

Tag: linux

Is there a way to remove results from find in linux?

I have a directory with backups. One backup file is created each day. I need to remove these files as they fill up disk space over time. I want to remove all files older than 5 days, BUT I need to keep a minimum of 5 files in the directory. This is in case the backup utility fails 5 days

How to get all ip ranges from asn?

I want to get all IP address ranges/blocks from as number. I can search throw google but need to write them manually. I want to get them all at once? Is this possible to get only ip address ranges from websites at once? Answer You can use whois servers instead of bgp.he.net or any other websites like this. wh…

make: how to append text to beginning and end of list?

In the makefile I’m writing, I am using the shell command find to build a list of source files to compile. In particular, I’m using the line: Now this works just fine. However, I would like to add support for excluding files that have a pattern that appears in a list called EXCLUDE. I’d like…

Capturing output from a background subshell in bash?

I’m trying to run multiple subshells in a bash script and capture the stdout result to a variable. When I run the subshell in the background I would expect I can use wait to let the subshell complete and then use the variable the result is assigned to later in the program…. but it doesn’t se…

Shell Script : MongoDB Dump

I’m creating a shell script to automatically dump the database. I have the current code below. The problem is when I’m opening the zip file it shows a single binary file. Usually, when I dump manually it consists of bson and json files. I don’t know what I’m doing wrong I’m expec…