Quantcast
Channel: User ozzy - Unix & Linux Stack Exchange
Browsing all 31 articles
Browse latest View live

Comment by ozzy on how to capture details from nc

@yael I didn’t downvote your question. Why do you assume it was me?

View Article



Comment by ozzy on Using pv with md5sum

Since you are not feeding 4Gb of data down the pipe, but just the output of md5sum for a plurality of files, changing the -s 4g option such that it reflects an estimate of the size of md5sum's output,...

View Article

Comment by ozzy on Using pv with md5sum

@frostschutz You are undeniably right :-) This is a nicer, cleaner solution.

View Article

Comment by ozzy on How can i remove duplicate files that contain 2 matching...

@jonnyb Can you insert an "echo $k" above the if-statement (below the k-assignment) to see what the bad key is? I don't have a bad key for the files you showed in your post.

View Article

Comment by ozzy on Identify and email results

@BradJenkins That sounds like doing scriptable work. What is the problem with the script-solution? Running a local MTA or smth else?

View Article


Comment by ozzy on Removing leading zero in pipe delimiter file using awk

@Mouli This is one of the beauties of awk: an entire record (here: a line) is referred to as $0; it is composed of the different fields into which it is automatically split based on the input field...

View Article

Comment by ozzy on Run script in background using `&` or `()&`?

Possible duplicate of: putting subshell in background vs putting command in background

View Article

Answer by ozzy for Convert file contents to lower case

Further to MvG's answer, you could also use Perl 6: perl6 -pe .=lc temp Here $_ is implicit, and you don't need the single quotes to protect it from expansion by the shell ($_ being a special Bash...

View Article


Answer by ozzy for Getting bash: mvn: command not found

It seems you downloaded a source archive (see the "-src" in the filename) that does not contain the binary you are trying to run. Try downloading and unpacking a binary archive (with "-bin" in the...

View Article


Answer by ozzy for Is there a character as `delim` of `read`, so that `read`...

The answer is generally "no", simply because - as a general rule - there is no actual character in a file that conclusively marks the end of a file. You are probably well advised to try a different...

View Article

Answer by ozzy for Unix command to search with a string of 6 numbers for any...

Assuming that you have a file named file that contains lines with mutually different whitespace-separated numbers, and you have a set of 6 numbers - e.g. 38, 39, 40, 41, 42, 43 - that you want to...

View Article

Answer by ozzy for How to extract duplicate numbers from a log file?

You could use: grep -oP 'SubscriberNumber=\K(\d+)' logfile | sort -n | uniq -cd grep -oP 'SubscriberNumber=\K(\d+)' logfile isolates all individual SubscriberNumbers from your logfile; sort -n sorts...

View Article

Answer by ozzy for want to Rename Images In Bulk in Linux

In Bash, the solution could look like this: #!/bin/bash shopt -s extglob for fn_old in *.jpg; do i=0 fn_new=${fn_old##+([-0-9])} # strip leading number sequence in basename...

View Article


Answer by ozzy for how to find & replace a file path listed in a file

You could use: sed -i -E -e 's/(\/.*\/)(.*\.idt)/\2/' file_list This performs an in-place (-i) replacement of all /..../filename.idt filepaths with filename.idt ("all" as in: the first occurrence on...

View Article

Answer by ozzy for Awk - convert time value to decimal value

How about this? awk -F: '{printf "%.1f", ($1*60+$2)/60}' <<< 1:30

View Article


Answer by ozzy for how can I merge two text files together

If file1 is your first text file, and file2 is your second text file, this should work in Bash: join -a 1 <(sort -k1,1 file2) <(sed -E -e 's/([^\s])\(/\1 (/' file1 | sort -k1,1) Join is called...

View Article

Answer by ozzy for Run parallel command and redirect the output to files with...

Well, this is a somewhat over-engineered Bash-solution, but it works and hopefully clarifies the use of the parallel command: function xx(){ curl "https://jsonplaceholder.typicode.com/todos/$1" >...

View Article


Answer by ozzy for Understanding why hostname -i returns strange IP address

Unlike the hostname -I command, which just lists all configured IP addresses on all network interfaces, the hostname -i command performs name resolution (see the hostname man page). Since your newly...

View Article

Answer by ozzy for About ||||| (pipe or vertical bars) In yad --form --button

I cannot reproduce the situation you describe entirely, but I think you need to ask yourself what you want yad to do when a button is pressed, or, more specifically, how yad should communicate any user...

View Article

Answer by ozzy for Getting the last sentence of a running program from...

This should work: grep -m1 -oP '(\d{1,3}\.?){4}:\d{1,5}' <( your-qemu-command 2>&1 ) <( your-qemu-command 2>&1 ) is a process substitution that launches qemu with stdout/stderr...

View Article
Browsing all 31 articles
Browse latest View live




Latest Images