Linux OS Dev

Kernel programming for Linux operating systems can be done with many different languages; C, C++, Python, Perl and Java, which are some of the most common languages used.There are also many different varieties of Linux, such as Ubuntu, Fedora and OpenSUSE.

Share tech news, updates, or what's on your mind.

Sign up to Post

If my rsyslog.conf is configured to write *.info *.warn *.kern and some others to /var/log/messages is there any way to identify the local6 *.info messages apart from the *kern and *.warn and others in  /var/log/messages? I've noticed sometimes that the messages contain kern and warn but not just sure what *.info are and if there's an easy way to identify them
I'd rather not have to configure /etc/rsyslog.conf to have another log file for just *.info if it can be avoided. If there's no other way then I might just have to do it but I'm curious what the local 6 information messages actually are.
0
JavaScript Best Practices
LVL 12
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

how to grep multiple awks

$ awk '{print;}' employee.txt
100  Thomas  Manager    Sales       $5,000
200  Jason   Developer  Technology  $5,500
300  Sanjay  Sysadmin   Technology  $7,000
400  Nisha   Manager    Marketing   $9,500
500  Randy   DBA        Technology  $6,000


$ awk '{print $2,$5;}' employee.txt
Thomas $5,000
Jason $5,500
Sanjay $7,000
Nisha $9,500
Randy $6,000

in above query how to tweak to see  see all records whose name starts with 'S' and Salary greater than '6000'

also
in above query how to tweak to see  see all records whose name starts with 'S' and Salary greater than '6000' and Department Starts with  'T'


100  Thomas  Manager    Sales       $5,000     08/08/1988 6:00:01AM
200  Jason   Developer  Technology  $5,500 08/08/1989 7:00:02AM
300  Sanjay  Sysadmin   Technology  $7,000 08/08/1982 9:00:03AM
400  Nisha   Manager    Marketing   $9,500 08/08/1981 10:00:04AM
500  Randy   DBA        Technology  $6,000 08/08/1981 11:00:5AM
if it has joined date and time as above
in above query how to tweak to see  see all records whose name starts with 'S' and Salary greater than '6000' and Department Starts with  'T' and joined between particular date time to particular date time say  08/08/1982 9:00:03 AM till 08/08/1981 10:00:04AM
i need to use above in a zgrep command

https://www.thegeekstuff.com/2010/01/awk-introduction-tutorial-7-awk-print-examples/
0
Dear Experts

We are having web-based application on linux which uses LAMP  which is production server recently the web-based application stops working for some time later it resumes back and when checked the /var/log/messages can find the following
kernel: Out of memory: Kill process 249606 (httpd) score 32 or sacrifice child
Sep 13 13:19:27 NYSWB kernel: Killed process 249606, UID 48, (httpd) total-vm:2826972kB, anon-rss:1334424kB, file-rss:2044kB
attached /cat/proc/meminfo and also fdisk -l , the system has 32G of physical RAM,
please suggest should i have to create one more swap partition OR should I have to edit swap config if yes please help me with steps, or any other steps on any config to be done please let me know, thank you.
memandfdisk.txt
0
I'd like to determine in my bash script which NIC the default gateway is on in order to determine if i need to add static routes via the script or not. Since there are two instances of 0.0.0.0 in the routing table where the default gateway is I'n trying to determine the NIC mentioned in the routing table where there are two instances of 0.0.0.0. Then if it matches ${DftNic} below I no I won't have to add static routes on the server. Scratching my head on this so any help would terrific.

DftNic=$(ip route show | grep default  awk '{print $7}')
0
zgrep 'XYZ|AB|MASTER' AAAA.log.20180904.gz | grep '|[1-9][0-9][0-9][0-9][0-9]|0000' | wc -l

can you please advise what is the meaning of above zgrep command

where i can find, practice and learn above kind of commands

how grep and egrep are different

https://ryanstutorials.net/linuxtutorial/grep.php
how to learn regular expressions used in queries

Please advise
0
See: https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritecond


-h
Is symbolic link, bash convention.
See -l.


-l
Is symbolic link.
Treats the TestString as a pathname and tests whether or not it exists, and is a symbolic link. May also use the bash convention of -L or -h if there's a possibility of confusion such as when using the -lt or -le tests.


-L
Is symbolic link, bash convention.
See -l

What are the differences between these three?

"-h" has "bash concention" and "-l" not. But what is the difference in practise? Can someone give me an example of the difference?

And why it's "-L" and not "-H"? "-L" is about the bash convention, but "-l" not. However, "-h" is. So then I would expect "-H" instead of "-L".

I don't need it for something right now, but I'm trying to understand the Apache documentation.
0
I need to script finding which of the NICS on the server is the one the IP the hostname of the server runs on my Redhat 5 and Redhat 6 x86 servers. This is only part of the script since I'll use the variable for comparison later on in the script but below is how I'm going to do it. Do you think there is a better way to do it or do you think this is good enough? What I'm relying on is that $(hostname) actually matches the entry in /etc/hosts but sometimes hostname has FQDN and sometimes not.

host=$(hostname)

HOSTIP=$(cat /etc/hosts | grep ${host} | awk ‘{print $1}’)
 
if [  ! -z ${HOSTIP} ]; then
          HOSTNIC=$(/sbin/ifconfig -a | grep -B2  ${HOSTIP} )
   else
         printf “HOST NIC IS UNKNOWN”
         exit 1
fi
0
I have multiple NICs on my Redhat 6 x86_64 server and as part of my script I have to determine which NIC is the default gateway on each server since there are lots of static routes over the other NICS. I always see the default gateway as the last line in the routing table but is that logic flawed and I just run net stat -rn | tail -1 | awk '{print $8}' but I'm not sure if that logic is up to par and I'm going to have to tally it up with what's in /etc/sysconfig/network as the gateway.
0
hi am not able to type in my terminal its seemed locked and when the vm in locked am not able to type password am in solaris running in oracle vm
0
how to enable/disable systmctl "systemd command)?
0
Angular Fundamentals
LVL 12
Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

Hi,

I'm running CentOS Linux release 7.4.1708 (Core), issue is i'm able to login using local users but not using ldap users, please help me on this.

I've tried restarting services using authconfig-tui command, but still i'm getting authentication failure error for ldap user.

please see the attached doc (ldap issue.docx), and below output commands and let me know if any other details are required.


[root@server01 log]# cat /etc/openldap/ldap.conf
#
SASL_NOCANON    on
URI ldap://<ldap servrer ip>:389/
BASE dc=prod,dc=hclpnp,dc=com
#
[root@server01 log]# getent passwd testuser
testuser:*:123456:7001:testuser:/home/testuser:/bin/bash
[root@server01 log]#


[hubba@servder01 ~]$ su - testuser
Password:
su: Authentication failure



[root@server01 log]# cat /etc/nsswitch.conf
#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Valid entries include:
#
#       nisplus                 Use NIS+ (NIS version 3)
#       nis                     Use NIS (NIS version 2), also called YP
#       dns                     Use DNS (Domain Name Service)
#       files              …
0
hi i what to put comma delimeted when i do cat of file





cat filename*.out > filename.out



the file is like this

DB: eca1

Input truncated to 37 characters





NSN     INSTANCE   Unit Code

----------- --------- ----------

18-018-6113 ECA1    10582





DB: fsa1

Input truncated to 37 characters





NSN     INSTANCE   Unit Code

----------- --------- ----------

18-018-6113 FSA1    10622



i what file to be like this so i can put in excell



NSN           INSTANCE   Unit Code

18-018-6113 FSA1           10622

18-018-6113 ECA1         10582
0
I have an RHEL5 VM that reboots on kernel panics. The VM hangs while rebooting at different stages of the bootup process.
I noticed the console shows the cursor blinking but stays stuck booting up and does not progress.

Any ideas on how to troubleshoot? The blinking cursor indicates the system is hung, correct?
0
file create error on below site


https://www.tutorialspoint.com/execute_bash_online.php

please advise how to create some files and practice grep commands there

any other online free tools to practice unix.

please advise
fileCreate.png
0
what is the meaning of below command

zgrep 'CUSTOMERPASS' abcd.20180719.gz|grep -v 'Trials: 1'|less



Is there is single link, tutorial or video tutorial where i can find above kind of command
and
count command

more
less
grep
etc.

alll commonly used commands like above
why we need | before less?

Please advise
0
how to find number of count in the unix logs for a grep search keyword say 'nullpointerexception on deviding 109418 with 0' please advise
0
server times out

i have 15 production unix server instances to check logs same time

when i am on one monitor other monitor times out in every 15 minutes

if i type
tail -f logfile


does it still times out on me

i cannot change time out setting myself

just looking for some work around so that i do not have to enter username and password all over again
0
transactions search in unix logs


in the unix logs of transactions each transaction has bunch of values like

transaction_id|transaction_time|transaction_description|transaction_type| ......etc



if i want to display only the transactions that took more than say 30 minutes and whose transaction_type is "sell"

how do i frame my grep command for that

any sample queries, links, resources, sample video tutorials on this

Please advise
0
what is the meaning of below command

less log123.log | grep -i nullpointerexception


why we use less and then grep on it

Please advise
0
Introduction to Web Design
LVL 12
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

in vi we can use /nullpointerexception to find that string right.

how to find how many occurrence of that string total and go to say 10th occurence line
please advise
0
when i open with winscp that opens old stale file compared to putty opening of same file say xyz.ccfg

i wonder why winscp does not show recent changs?

please advise
0
how to import sessions from putty or mputty to securecrt.
https://www.vandyke.com/products/securecrt/

I recently installed securecrt not sure how to import all existing conections to different servers on different environments that are present in putty to winscp.

any tips on effective use of securecrt as i am new to it

Please advise
0
Hi Experts

Could you point a good tool / strategy to a HD under Lubuntu defragmentation?

Thanks in advance
0
1. Can someone explain me if there is any changes in .cloginrc file, I need to run the rancid-cvs and rancid-run,
2. When i am trying to login i can see that the username is not pulling from what is there in .cloginrc.

For Eg:
(Under my clogin file)
I have mentioned
add user 1x.x.x User1
add password 1x.x.x       {password}
add method 1x.x.x telnet ssh

But when i am trying to login, i can see that username is in rancid. I am not sure why its happening. And to make sure that if try firewall login or normal login, its going with actual username only
0
on my windows 10 machine after installing oracle virtua box and centos on top of it while starting getting below error


Failed to open a session for the virtual machine centos.

The virtual machine 'centos' has terminated unexpectedly during startup with exit code 1 (0x1).  More details may be available in 'C:\Users\saiganesh\VirtualBox VMs\centos\Logs\VBoxHardening.log'.

Result Code: E_FAIL (0x80004005)
Component: MachineWrap
Interface: IMachine {b2547866-a0a1-4391-8b86-6952d82efaa0}

i tried on other laptop i do not see red hat 64 some reason but shows red hat 32 bit

Please advise
centos.png
centos.png
0

Linux OS Dev

Kernel programming for Linux operating systems can be done with many different languages; C, C++, Python, Perl and Java, which are some of the most common languages used.There are also many different varieties of Linux, such as Ubuntu, Fedora and OpenSUSE.

Top Experts In
Linux OS Dev
<
Monthly
>