Search Results

Search: Posts Made By: MadeInGermany
153
Posted By MadeInGermany
Regarding the version: lsb_release -a The given...
Regarding the version: lsb_release -a
The given kernel version only match for RHEL 7.7 or CentOS 7.7. Where the technical differences are neglectable.

The given grep command is one method to find...
131
Posted By MadeInGermany
You must prune the excluded directory. -o...
You must prune the excluded directory. -o continues when not pruned.
Further, find is recursive; you may not run another recursive command in it.
find /mysite/public_html -wholename...
346
Posted By MadeInGermany
Obviously the default timeout is too high. Add...
Obviously the default timeout is too high.
Add two lines to /etc/resolv.conf
options timeout:2
options attempts:2

These values will give a total delay of 2 * 2 = 4 seconds when the first DNS...
238
Posted By MadeInGermany
The -H is specific to GNU ps (Linux). It does...
The -H is specific to GNU ps (Linux).
It does an indentation (two spaces per hierarchy level) without any ASCII art. This is easy to post-process i.e. filter for the releavant parts.
238
Posted By MadeInGermany
Sorry, somehow my copy/paste left out a bunch of...
Sorry, somehow my copy/paste left out a bunch of lines.
Now I have corrected my original post.

--- Post updated at 11:24 ---

@nezabudka, the goal was to only show a relevant part of the...
238
Posted By MadeInGermany
[Tip] ptree for Linux
Unix (and Linux) uses a process tree that gives a natural security, by simple inheritance of attributes.

The following ptree script shows it. It runs on all Linux flavors.
Mostly useful for...
344
Posted By MadeInGermany
Add # sed '/^&@@10.10.10.10/ s/^/#/'...
Add #
sed '/^&@@10.10.10.10/ s/^/#/' /etc/rsyslog.confRemove #
sed '/^#&@@10.10.10.10/ s/^#//' /etc/rsyslog.confThe & is special in sed in the replacement string. This is avoided now.
But:
The $...
437
Posted By MadeInGermany
Can be done as a { } group. (Note: there must be...
Can be done as a { } group. (Note: there must be a semicolon or newline before the closing brace! And of cause spaces next to the [ ] { } )
if [ -f ./file2 ] && [ -f ./file3 ] && { [ -f ./file1 ]...
319
Posted By MadeInGermany
The latter suggestion is portable. Once defined...
The latter suggestion is portable.
Once defined as a function it becomes handy:
rightpad0() { printf "%s%0$((${1}-${#2}))d\n" "${2}"; }

rightpad0 9 2457
245700000
Forum: Shell Programming and Scripting 2 Weeks Ago
428
Posted By MadeInGermany
Or do all in bash - here is a well documented...
Or do all in bash - here is a well documented bash version:
#! /bin/bash
# bash v3 or higher

# file with list of items to find in modify_file
list_file=$1
# file for which a modified copy will...
655
Posted By MadeInGermany
You can save half of the memory by not storing in...
You can save half of the memory by not storing in arrays.
set -f # for safety: no filename generation
for i in $(cat elementen.txt)
do
for b in $(cat ITEMID.txt)
do
db2 -x "select...
644
Posted By MadeInGermany
If you have a rule like "cdc must appear at the...
If you have a rule like "cdc must appear at the beginning of the line and followed by a character",
then a simple RegularExpression does it:
perl -pe '/^cdc./ and s/^/#/' abc.txt
A -i option will...
433
Posted By MadeInGermany
In awk better print "quotes" around the filenames...
In awk better print "quotes" around the filenames because they become command arguments in sh where unquoted arguments are subject to substitutions.
{print "cp \"" FILENAME "\" /test/V_files/";...
Forum: Shell Programming and Scripting 3 Weeks Ago
566
Posted By MadeInGermany
Be careful with echo and with unquoted variables...
Be careful with echo and with unquoted variables in command arguments!
From [Tip] A better echo (https://www.unix.com/shell-programming-and-scripting/283413-tip-better-echo.html)
# Portable echo -e...
1,218
Posted By MadeInGermany
The point is: set a real limit. "Unlimted"...
The point is: set a real limit.
"Unlimted" means a process is allowed to consume all system resources. And a buggy/wild/looping process could do so.
895
Posted By MadeInGermany
They mean: copying a file, especially a big file,...
They mean: copying a file, especially a big file, is done in steps. If there is a power loss in between, the status of the file is unknown: can be empty or partially copied.
In contrast,...
614
Posted By MadeInGermany
Your problem is the wrong destination in the cp...
Your problem is the wrong destination in the cp command; it must be dir/file.
Together with a few improvements:
a=1
for i in */dnaG.fasta
do
cp "$i" fastcancatg/"$a"_"$i"
a=$(( a + 1 ))...
626
Posted By MadeInGermany
There are several further mistakes in your...
There are several further mistakes in your script:
Text message in MEM_LOAD (that you cannot compare with a numeric value),
two useless code lines about PROC and CPU_LOAD,
useless use of echo,...
792
Posted By MadeInGermany
PAE was invented for 32bit kernels, in order to...
PAE was invented for 32bit kernels, in order to address more than 4GB.
It allowed many apps to consume more than 4GB, but I have my doubts that a single app could address more than 4GB.

PAE...
Forum: Shell Programming and Scripting 4 Weeks Ago
725
Posted By MadeInGermany
Only match 443 or 9443, most simple as ERE (egrep...
Only match 443 or 9443, most simple as ERE (egrep or grep -E)
egrep '^Listen[[:blank:]]+9?443$'
Using a Posix character class rather than a GNU \s
795
Posted By MadeInGermany
Like this? awk '{...
Like this?
awk '{ last2=substr($NF,length($NF)-1); if (last2 <= 33) printf "%12s\n", $NF }' listacos.txt
723
Posted By MadeInGermany
Quick and dirty - do not use with file names with...
Quick and dirty - do not use with file names with space or other special characters!
ls -lrt | grep " Dec 18 14:" | awk '{ print $NF }'
This gives the file names. You can use xargs to convert stdin...
886
Posted By MadeInGermany
[Tip] A better echo
Often it has been said that echo is neither portable nor correct.
Here is an input.txt:

line1
line2
-n
line4
-en
line6
-x
line8
Then the following fails with BSD/Linux/bash:

while IFS=...
822
Posted By MadeInGermany
awk '$1=="zone" { del=($2~/deletethisentry.com/)...
awk '$1=="zone" { del=($2~/deletethisentry.com/) } !del' /var/named/zones.conf
If Field#1 is "zone" then set del according to field#2 containing "deletethisentry.com"; print if del is 0.
1,187
Posted By MadeInGermany
The shorter pathnames is a small improvement only...
The shorter pathnames is a small improvement only when post processing the output.
Then, you can bundle the names (shortens the command, not so much the run time).
But a + instead of the \; will...
Showing results 1 to 25 of 500

 

Featured Tech Videos

All times are GMT -4. The time now is 10:20 AM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy