All Questions
33 questions
-2
votes
1
answer
43
views
linux + network scanner tool that discover Linux rhel machine
we have network lab range from 18.2.1.1 until 18.7.252.253 , and we want to capture only the Linux RHEL machines with version 7.x ( /etc/redhat-release ) , ( we have around 2870 machines and only 390 ...
2
votes
1
answer
1k
views
bash + monitor disk space usage and execute script if used space reached the threshold
We want to follow the used space of /var/hadoop/hdfs partition , by way if used space is more the 50% then as results we run the script – do_action.bash , finally this command should be in crontab and ...
-1
votes
1
answer
1k
views
bashrc + why source not refresh the .bashrc file
we add the following line to bashrc file
alias reboot="echo you not allowed to do reboot on this machine - sorry"
so we get
more ~/.bashrc
# .bashrc
# User specific aliases and functions
...
0
votes
2
answers
3k
views
How to ignore the error from mv: cannot move ‘XXXXXX to a sub directory of itself
On our RHEL 7.6 server we create the following folder
# mkdir -p /var/data/data-logs_temp
the second part is to move all content under /var/data/ to /var/data/data-logs_temp by:
# mv /var/data/* /...
0
votes
1
answer
656
views
LINUX - Last login for root user
on a redhat server I logged with my domain username, and then switched as root.
As I switched as root I received the message for the last login for root (Last login: ....).
I am asking if the "...
-3
votes
1
answer
60
views
find + delete folders with extension when using variable
we have linux rhel machine 7.2 with the following folders under /kafka/topics
drwxr-xr-x 2 root kafka 141 May 11 17:19 bgol.ase.fgt.dad3-1
drwxr-xr-x 2 root kafka 141 May 11 17:19 bgol.ase.fgt....
0
votes
1
answer
2k
views
Bash coming on zsh, why?
I currently switched to zsh from bash but, when I type wrong command, instead of zsh:<wrong-command>: command not found, comes bash: <wrong-command>: command not found it is something ...
0
votes
1
answer
229
views
find + search huge files in short time
I am using the following find syntax in order to find huge std* files that are more then 1000M.
find /data -type f \( -name "stdout" -o -name "stderr" \) -size +1000M -print
...
0
votes
1
answer
1k
views
How to read session history currently in memory (the history that eventually gets written to ".bash_history" upon logout
I've encountered this issue several times where I need to access the history of a currently active session. Unless there is an easier way, I'm about to write a C program to read this from a target ...
1
vote
3
answers
84
views
How can I grep columns that match in the same row?
I want to get the end date for an installed subscription, and currently using
subscription-manager list --installed | grep Ends | awk '{print $2 }')
The complexity comes when there are multiple ...
-4
votes
3
answers
283
views
Parsing ranges into discrete values, in Bash
User will provide a list containing ranges.
I need to convert it to a list of discrete values.
For example
Input
host[1-5],host7,host[13-15]
Output
host1,host2,host3,host4,host5,host7,host13,host14,...
-2
votes
2
answers
228
views
I have multiple files and file with different versions . I need how to pick the highest numbered version from every file
I have multiple files and file with different versions . I need how to pick the highest numbered version from every file .
ex:
ac-1
ac-2
bc-1
bc-2
Desired output.
ac-2,bc-2
2
votes
1
answer
124
views
how to change value of parameter recursive under folder
under /etc/sysconfig/network-scripts ,
we have network configuration files as
ifcfg-conf1
ifcfg-conf2
.
.
.
is it possible to change all parameters - PEERDNS to no , if value is yes
expected ...
2
votes
2
answers
1k
views
Completely Clear Bash History From Shell Script (sysprep)
I'm working on a sysprep-style script which de-identifies a machine and gets it ready for templatizing. The last task that I'd like to perform (before shutdown) is clearing the bash history for the ...
0
votes
0
answers
67
views
su <user> -c "sudo -l > some_file adding line breaks
Getting a really strange problem that I cant really get my head around at all. I am running a script as root to check a number of sudo rules are present as user X. When I run:
su $USER -c "sudo -l &...