Category "unix"

How do xargs and gnu parallel differ when parallelizing code?

Here's a basic question. I'm curious as to how do xargs and gnu parallel differ when parallelizing code? And are there use cases in which you'd use one over the

escaping newlines in sed replacement string

Here are my attempts to replace a b character with a newline using sed while running bash $> echo 'abc' | sed 's/b/\n/' anc no, that's not it $> echo

grep for a pattern "variable=value" and returning only matching entries having a value > threshold

I am searching a kubernetes pod logs for the pattern “variable=value” ( e.g., variable=10 or variable=500) using the command below: Kubectl logs -f

grep positive/negative integer value only

I am looking to grep any positive/negative integers only and no decimals, or any other variation including a number. I have a testpart1.txt which has: This is a

How to get latest file from sftp server to local using mget in linux?

Hi I am following below logic to get the latest file from sftp server. But it is copying all the files. Please help what I need to correct in my logic? datadir=

AWK return/print as associative arrays in Bash

With this command I am trying to filter through my firewall. In order to extract the firewall rule ID number and the IP address. existing=($(ufw status numbered

How to read user interaction of rm -I command and store in a variable shell scripting

so this function basically runs similar to rm -i command and the arguments are passed while executing (eg. bash script_Name test.txt). rm -i $file does ask me t

Write a shell script to find the largest among three numbers. Get user inputs and display the result

Write a shell script to find the largest among three numbers. Get user inputs and display the result. Sample input 1: 10 20 30 Sample output 1: 30 is lar

shell script to print sum of digits of the given num.In case of negative num is given as input, display Not a positive num as o/p

I'm getting the proper output, but only for positive inputs. read n g=$n s=0 k= if [ $n -gt 0 ] ; then echo "Not a positive number" else while [ $n -gt 0 ]

Identify the files year wise and delete from a dir in unix

I need to list out the files which are created in a specific year and then to delete the files. year should be the input. i tried with date it is working for me

Unzip specific files in a ARR file within a Tar.gz

i'am currently trying to unzip some specific files within a ARR file. This ARR file is within a tar.gz file. Is it possible to unzip these files without a inter

Trying to delete all shared memory and semaphore arrays in ipcs but get permission denied?

Can't find this anywhere online but when trying to delete semaphore arrays and shared memory using ipcrm -m id. I get this error permission denied for id (<i

Extract a string between double quotes from the 6th line of a file in Unix and assign it to variable

Newbie to unix/shell/bash. I have a file name CellSite whose 6th line is as below: btsName = "RV74XC038", I want to extract the string from 6th line that i

Getting the error: bash: (program): cannot execute binary file: Exec format error, on both 32-bit and 64-bit Windows

There is a program developed for linguistic research (http://people.csail.mit.edu/mcollins/code.html). When I try to run the parser using Git bash terminal on W

Change indented multiline string in file in terminal

i want to change multiline string within particular marks that is indented in file, example looks like this: non_important_array: [ text ], impo

Which of these answers are the equivalent of O_RDWR on Ubuntu 14.04 LTS?

I have been given a list of the following check box containing all possible solutions to the question of choosing all true answers equivalent to O_RDWR on Ubunt

Postman to prometheus and carriage "\r"?. text format parsing error in line 1: expected float as value, got "1\r"

Just trying to add new metric to Prometheus through the Postman, but getting text format parsing error in line 1: expected float as value, got "1\r" Metric ju

ignoring specific exit code in bash

Note: Question does not duplicate Ignoring specific errors in a shell script . Suppose it is needed to capture the leading characters of a encoded representati

How do you set your pythonpath in an already-created virtualenv?

What file do I edit, and how? I created a virtual environment.

Can't Run Go Bin In Terminal

I have been executing my Golang code on Visual Studio in the terminal for the past few weeks. All of a sudden I am trying to run a program I made, and it does n