How 2 Know
If you can't Google it, You Can Knowing it.

Archive for the ‘Linux’ Category

Recursively replacing a string in all files in a directory

Wednesday, April 11th, 2018

You can use the following command to change Specific string on all files under specific directory:

find /u01/directory -type f | xargs perl -pi~ -e ‘s/oldtext/newtext/g;’

Tested on Linux & AIX

Ref:
https://blogs.oracle.com/rammenon/recursively-replacing-a-string-in-all-files-in-a-directory-linux

How to disable LDAP Authentication in Linux

Wednesday, October 28th, 2015

After a customer had performed some bad edits on various LDAP configuration files, users were locked out and unable to access the system. Root could still login however.

I logged in as root, and rather than mess with various config files, eg under /etc/pam.d, ran this command to disable LDAP authentication and enable “normal” authentication using /etc/shadow:

Continue Reading…

Useful Commands for Redhat LVM and increasing Filesystem

Sunday, September 20th, 2015

– Scan New Hardware:
scsi-rescan
rescan-scsi-bus.sh –forcerescan

– For Physical Volumes:
pvdisplay
pvscan
pvcreate /dev/sdb

– For Volume Groups:
vgdisplay
vgscan
vgextend VGNAME PVNAME
lvextend -L+50G LVNAME
resize2fs LVNAME

LVM

Saturday, September 20th, 2014

LVM :- Logical Volume Manager and it’s a disk Management for Linux/UNIX Systems.

How To Check Linux Hardware Info

Saturday, July 5th, 2014
lscpu

Reports info about the cpu and processing units.

lshw

Reports detailed/brief info about multiple hardware units like cpu, memory, disk, network adapters etc.

Continue Reading…

uncompress files using jar command

Sunday, February 23rd, 2014

you can uncompressed zipping files using java, specially “jar” command:

 

to do that , try the following :

 

/usr/java6/bin/jar -xvf /tmp/test.zip

run levels description

Saturday, December 21st, 2013

The Following points shows the meaning of each run level :

  • on LINUX-UBUTNU/DEBIAN:

0 – halt
1 – single user
2 – multiuser (default)
3 – same as 2
4 – same as 2
5 – same as 2
6 – reboot Continue Reading…

how to know current run level

Saturday, December 21st, 2013

run the following command to know your current run level:


# who -r
         run-level 2  2013-12-20 00:39

how to know your operating system release

Saturday, December 21st, 2013

if you want to get your operating system relase you have 2 ways to do that:

First: you can run the following command:

# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 13.04
Release:	13.04
Codename:	raring

Continue Reading…