Showing posts with label Redhat. Show all posts
Showing posts with label Redhat. Show all posts

Friday, June 10, 2016

How to kill all session Xvnc

 

Step 1: List all processes of Xvnc

[root@VTGDB.COM tmp]# ps -ef | grep Xvnc
root     112273      1  1 14:22 pts/0    00:00:00 /usr/bin/Xvnc :1 -desktop VTGDB.COM:1 (root) -auth /root/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5901 -fp catalogue:/etc/X11/fontpath.d -pn
root     112688 110375  0 14:22 pts/0    00:00:00 grep Xvnc

Step 2: Kill all processes of Xvnc

[root@VTGDB.COM tmp]# kill -9 112273

Step 3: Delete all file .X*-lock

[root@VTGDB.COM tmp]# cd /tmp
[root@VTGDB.COM tmp]# ls -a
 sess_8dmq10bg3vnbdcrcqo9ogpsi55  sess_ngvl5qf7pgv4ill44lbfa0q084  .X11-unix
db2chgpath_db2.log.73213   db2prereqcheck.log.128450  .esd-54323                .ICE-unix               .java_pid63614   orbit-oracle                seahorse-KUSesH                  sess_98ta84ni8cvcp1eo18auf3ccd0  sess_tvabjtkkmseko3t3e3q4c69o54  .X1-lock

[root@VTGDB.COM tmp]# rm -fr .X1-lock
[root@VTGDB.COM tmp]# cd .X11-unix/
[root@VTGDB.COM .X11-unix]# ls
X1
[root@VTGDB.COM .X11-unix]# rm -fr *
[root@VTGDB.COM .X11-unix]#

Thursday, May 19, 2016

Wednesday, May 18, 2016

How to set an expiration date for user' password on Linux

Step 1: Open file /etc/login.defs, change option for PASS_MAX_DAYS, For example:

# Password aging controls:
#
#       PASS_MAX_DAYS   Maximum number of days a password may be used.
#       PASS_MIN_DAYS   Minimum number of days allowed between password changes.
#       PASS_MIN_LEN    Minimum acceptable password length.
#       PASS_WARN_AGE   Number of days warning given before a password expires.
#
PASS_MAX_DAYS   90

Step 2: With exist user, you can change expiration date via command:

[root@VTGDB.COM ~]# chage -M 90 username

Wednesday, March 2, 2016

How to install php 5.5.1.0 on linux


Step 1: Download the software

 

Step 2: Untar the downloaded file


[root@VTGDB.COM ~]# tar -xvf oel-dependency-install.tar.gz
oel-dependency-install/
oel-dependency-install/dependency-install.sh
oel-dependency-install/._libjpeg-turbo-1.2.1-3.el6_5.x86_64.rpm
oel-dependency-install/libjpeg-turbo-1.2.1-3.el6_5.x86_64.rpm
oel-dependency-install/._openssl-1.0.1e-16.el6_5.x86_64.rpm
oel-dependency-install/openssl-1.0.1e-16.el6_5.x86_64.rpm
oel-dependency-install/oracle-instantclient12.1-basic-12.1.0.1.0-1.x86_64.rpm
oel-dependency-install/oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.x86_64.rpm
oel-dependency-install/php55-5.5.10-1.el6.x86_64.rpm
oel-dependency-install/php55-bcmath-5.5.10-1.el6.x86_64.rpm
oel-dependency-install/php55-cli-5.5.10-1.el6.x86_64.rpm
oel-dependency-install/php55-common-5.5.10-1.el6.x86_64.rpm
oel-dependency-install/php55-dba-5.5.10-1.el6.x86_64.rpm
oel-dependency-install/php55-fpm-5.5.10-1.el6.x86_64.rpm
oel-dependency-install/php55-gd-5.5.10-1.el6.x86_64.rpm
oel-dependency-install/php55-intl-5.5.10-1.el6.x86_64.rpm
oel-dependency-install/php55-ldap-5.5.10-1.el6.x86_64.rpm
oel-dependency-install/php55-mbstring-5.5.10-1.el6.x86_64.rpm
oel-dependency-install/php55-mysql-5.5.10-1.el6.x86_64.rpm
oel-dependency-install/php55-oci8-12cR1-5.5.10-2.el6.x86_64.rpm
oel-dependency-install/php55-opcache-5.5.10-1.el6.x86_64.rpm
oel-dependency-install/php55-pdo-5.5.10-1.el6.x86_64.rpm
oel-dependency-install/php55-xml-5.5.10-1.el6.x86_64.rpm

Step 3: Install the software


[root@VTGDB.COM ~]# cd oel-dependency-install
[root@VTGDB.COM oel-dependency-install]# ls
dependency-install.sh                                   oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.x86_64.rpm  php55-common-5.5.10-1.el6.x86_64.rpm  php55-intl-5.5.10-1.el6.x86_64.rpm      php55-oci8-12cR1-5.5.10-2.el6.x86_64.rpm
libjpeg-turbo-1.2.1-3.el6_5.x86_64.rpm                  php55-5.5.10-1.el6.x86_64.rpm                             php55-dba-5.5.10-1.el6.x86_64.rpm     php55-ldap-5.5.10-1.el6.x86_64.rpm      php55-opcache-5.5.10-1.el6.x86_64.rpm
openssl-1.0.1e-16.el6_5.x86_64.rpm                      php55-bcmath-5.5.10-1.el6.x86_64.rpm                      php55-fpm-5.5.10-1.el6.x86_64.rpm     php55-mbstring-5.5.10-1.el6.x86_64.rpm  php55-pdo-5.5.10-1.el6.x86_64.rpm
oracle-instantclient12.1-basic-12.1.0.1.0-1.x86_64.rpm  php55-cli-5.5.10-1.el6.x86_64.rpm                         php55-gd-5.5.10-1.el6.x86_64.rpm      php55-mysql-5.5.10-1.el6.x86_64.rpm     php55-xml-5.5.10-1.el6.x86_64.rpm
[root@VTGDB.COM oel-dependency-install]# ./dependency-install.sh
Installing OMSS OEL dependencies...
Removing old versions of oracle-instantclient
rpm: no packages given for erase
Removing old versions of php...
rpm: no packages given for erase
Installing openssl-1.0.1e-16.el6_5.x86_64.rpm...
warning: openssl-1.0.1e-16.el6_5.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
            package openssl-1.0.1e-30.el6.x86_64 (which is newer than openssl-1.0.1e-16.el6_5.x86_64) is already installed
Installing libjpeg-turbo-1.2.1-3.el6_5.x86_64.rpm...
warning: libjpeg-turbo-1.2.1-3.el6_5.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
            package libjpeg-turbo-1.2.1-3.el6_5.x86_64 is already installed
Installing oracle-instantclient12.1-basic-12.1.0.1.0-1.x86_64.rpm..
Preparing...                ########################################### [100%]
   1:oracle-instantclient12.########################################### [100%]
Installing oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.x86_64.rpm...
Preparing...                ########################################### [100%]
   1:oracle-instantclient12.########################################### [100%]
Reloading ldconfig...
Intalling php55-common-5.5.10-1.el6.x86_64.rpm...
Preparing...                ########################################### [100%]
   1:php55-common           ########################################### [100%]
Intalling php55-cli-5.5.10-1.el6.x86_64.rpm...
Preparing...                ########################################### [100%]
   1:php55-cli              ########################################### [100%]
Intalling php55-5.5.10-1.el6.x86_64.rpm...
Preparing...                ########################################### [100%]
   1:php55                  ########################################### [100%]
Intalling php55-bcmath-5.5.10-1.el6.x86_64.rpm...
Preparing...                ########################################### [100%]
   1:php55-bcmath           ########################################### [100%]
Intalling php55-dba-5.5.10-1.el6.x86_64.rpm...
Preparing...                ########################################### [100%]
   1:php55-dba              ########################################### [100%]
Intalling php55-fpm-5.5.10-1.el6.x86_64.rpm...
Preparing...                ########################################### [100%]
   1:php55-fpm              ########################################### [100%]
Intalling php55-gd-5.5.10-1.el6.x86_64.rpm...
Preparing...                ########################################### [100%]
   1:php55-gd               ########################################### [100%]
Intalling php55-intl-5.5.10-1.el6.x86_64.rpm...
Preparing...                ########################################### [100%]
   1:php55-intl             ########################################### [100%]
Intalling php55-ldap-5.5.10-1.el6.x86_64.rpm...
Preparing...                ########################################### [100%]
   1:php55-ldap             ########################################### [100%]
Intalling php55-mbstring-5.5.10-1.el6.x86_64.rpm...
Preparing...                ########################################### [100%]
   1:php55-mbstring         ########################################### [100%]
Intalling php55-pdo-5.5.10-1.el6.x86_64.rpm...
Preparing...                ########################################### [100%]
   1:php55-pdo              ########################################### [100%]
Intalling php55-mysql-5.5.10-1.el6.x86_64.rpm...
Preparing...                ########################################### [100%]
   1:php55-mysql            ########################################### [100%]
Intalling php55-oci8-12cR1-5.5.10-2.el6.x86_64.rpm...
Preparing...                ########################################### [100%]
   1:php55-oci8-12cR1       ########################################### [100%]
Intalling php55-opcache-5.5.10-1.el6.x86_64.rpm...
Preparing...                ########################################### [100%]
   1:php55-opcache          ########################################### [100%]
Intalling php55-xml-5.5.10-1.el6.x86_64.rpm...
Preparing...                ########################################### [100%]
   1:php55-xml              ########################################### [100%]
  

Step 4: Check new installed php


[root@VTGDB.COM oel-dependency-install]# rpm -qa | grep php
php55-opcache-5.5.10-1.el6.x86_64
php55-common-5.5.10-1.el6.x86_64
php55-intl-5.5.10-1.el6.x86_64
php55-pdo-5.5.10-1.el6.x86_64
php55-cli-5.5.10-1.el6.x86_64
php55-mbstring-5.5.10-1.el6.x86_64
php55-dba-5.5.10-1.el6.x86_64
php55-oci8-12cR1-5.5.10-2.el6.x86_64
php55-bcmath-5.5.10-1.el6.x86_64
php55-mysql-5.5.10-1.el6.x86_64
php55-gd-5.5.10-1.el6.x86_64
php55-xml-5.5.10-1.el6.x86_64
php55-fpm-5.5.10-1.el6.x86_64
php55-ldap-5.5.10-1.el6.x86_64
php55-5.5.10-1.el6.x86_64
[root@VTGDB.COM oel-dependency-install]# ls
dependency-install.sh                                   oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.x86_64.rpm  php55-common-5.5.10-1.el6.x86_64.rpm  php55-intl-5.5.10-1.el6.x86_64.rpm      php55-oci8-12cR1-5.5.10-2.el6.x86_64.rpm
libjpeg-turbo-1.2.1-3.el6_5.x86_64.rpm                  php55-5.5.10-1.el6.x86_64.rpm                             php55-dba-5.5.10-1.el6.x86_64.rpm     php55-ldap-5.5.10-1.el6.x86_64.rpm      php55-opcache-5.5.10-1.el6.x86_64.rpm
openssl-1.0.1e-16.el6_5.x86_64.rpm                      php55-bcmath-5.5.10-1.el6.x86_64.rpm                      php55-fpm-5.5.10-1.el6.x86_64.rpm     php55-mbstring-5.5.10-1.el6.x86_64.rpm  php55-pdo-5.5.10-1.el6.x86_64.rpm
oracle-instantclient12.1-basic-12.1.0.1.0-1.x86_64.rpm  php55-cli-5.5.10-1.el6.x86_64.rpm                         php55-gd-5.5.10-1.el6.x86_64.rpm      php55-mysql-5.5.10-1.el6.x86_64.rpm     php55-xml-5.5.10-1.el6.x86_64.rpm

[root@VTGDB.COM oel-dependency-install]#

Tuesday, February 16, 2016

SSH Login & SCP Without Password Using ssh-keygen & ssh-copy-id

admin@local-host$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/admin/.ssh/id_rsa):[Enter key]
Enter passphrase (empty for no passphrase): [Press enter key]
Enter same passphrase again: [Press enter key]
Your identification has been saved in /home/admin/.ssh/id_rsa.
Your public key has been saved in /home/admin/.ssh/id_rsa.pub.
The key fingerprint is:
33:b3:fe:af:95:95:18:11:31:d5:de:96:2f:f2:35:f9 admin@local-host

admin@local-host$ ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host
admin@remote-host's password:
Now try logging into the machine, with "ssh 'remote-host'", and check in:

.ssh/authorized_keys


to make sure we haven't added extra keys that you weren't expecting.

Thursday, January 28, 2016

Thursday, December 3, 2015

Friday, November 27, 2015

Thursday, October 22, 2015

How to start network linux automatically



Step 1: Check your network

[root@PTUDServer3 ~]# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 74:46:A0:98:D0:BE 
          inet addr:192.168.2.133  Bcast:10.61.118.255  Mask:255.255.255.0
          inet6 addr: fe80::7646:a0ff:fe98:d0be/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7002 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1357 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:592469 (578.5 KiB)  TX bytes:118837 (116.0 KiB)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:2456 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2456 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:278546 (272.0 KiB)  TX bytes:278546 (272.0 KiB)

virbr0    Link encap:Ethernet  HWaddr 52:54:00:D9:D3:A7 
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

virbr0-nic Link encap:Ethernet  HWaddr 52:54:00:D9:D3:A7 
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

Step 2: Set ONBOOT=yes

[root@PTUDServer3 ~]#vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
TYPE=Ethernet
UUID=c47a963d-3fb0-44f5-b3c7-4ff8d619a043
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
IPADDR=192.168.2.133
PREFIX=24
GATEWAY=192.168.1.1
DNS1=10.79.255.10
HWADDR=74:46:A0:98:D0:BE
DOMAIN=10.79.255.12
LAST_CONNECT=1443171251

Step 3: Start network with OS.

[root@PTUDServer3 ~]# chkconfig network on

Step 4: Test Network

[root@PTUDServer3 ~]# service network restart
Shutting down interface eth0:  Device state: 3 (disconnected)
                                                           [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:  Active connection state: activated
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/1
                                                           [  OK  ]
[root@PTUDServer3 ~]# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=46 time=65.6 ms


Wednesday, September 16, 2015

Forwarding Network














Describe:
End User cannot access Server B via port 8000.
End User can access Server A via port 8000.
How to End User can access application on Server B which running port 8000?

Before Forwarding, end user cannot access via 8000.


Details:

1. Check Port Forwarding:
[root@PTUD-S05 ~]# ifconfig
bond0     Link encap:Ethernet  HWaddr 44:A8:42:18:29:55  
          inet addr:IP_SERVER_A  Bcast:10.30.164.191  Mask:255.255.255.192
          inet6 addr: fe80::46a8:42ff:fe18:2955/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:5433 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2084 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:540826 (528.1 KiB)  TX bytes:299158 (292.1 KiB)

[root@PTUD-S05 ~]# cat /proc/sys/net/ipv4/conf/bond0/forwarding 
0
[root@PTUD-S05 ~]# echo '1' > /proc/sys/net/ipv4/conf/bond0/forwarding 
[root@PTUD-S05 ~]# cat /proc/sys/net/ipv4/conf/bond0/forwarding 
1

2. Edit iptables for forwarding/
[root@PTUD-S05 ~]# vi /etc/sysconfig/iptables
# Generated by iptables-save v1.4.7 on Sat Sep 12 02:31:44 2015
*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]

-A PREROUTING -i bond0 -p tcp -m tcp --dport 8000 -j DNAT --to-destination IP_Server_B:8000
-A POSTROUTING -o bond0 -p tcp -m tcp -d IP_Server_B --dport 8000 -j SNAT --to-source IP_Server_A

COMMIT
# Completed on Sat Sep 12 02:31:44 2015
# Generated by iptables-save v1.4.7 on Sat Sep 12 02:31:44 2015
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [779:107936]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m tcp --dport 21 -j ACCEPT
#-A INPUT -j REJECT --reject-with icmp-host-prohibited
#-A FORWARD -j REJECT --reject-with icmp-host-prohibited

COMMIT
# Completed on Sat Sep 12 02:31:44 2015

3. Restart Iptables to apply it.
[root@PTUD-S05 ~]# service iptables restart
iptables: Setting chains to policy ACCEPT: filter nat      [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
iptables: Applying firewall rules:                         [  OK  ]
[root@PTUD-S05 ~]#
After Forwarding:


create an user OS which has privilege like root user

I will create user "bigdata" which has privilege like root user
[root@PTUD-VM02-4 ~]# chmod 640 /etc/sudoers
[root@PTUD-VM02-4 ~]# vi /etc/sudoers
## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
bigdata    ALL=(ALL)       ALL

[root@PTUD-VM02-4 ~]# chmod 440 /etc/sudoers

Thursday, September 10, 2015

Adding User on linux


[root@PTUD-VM01-2 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_ptudvm011-LogVol00
                       20G  8.5G   11G  46% /
tmpfs                 7.8G   72K  7.8G   1% /dev/shm
/dev/sda1             976M   36M  890M   4% /boot
/dev/mapper/vg_ptudvm011-LogVol03
                       49G   52M   46G   1% /u01
/dev/mapper/vg_ptudvm011-LogVol01
                       20G  361M   19G   2% /var
[root@PTUD-VM01-2 ~]# useradd wccc -d /u01/wccc
[root@PTUD-VM01-2 ~]# passwd wccc
Changing password for user wccc.
New password:
BAD PASSWORD: is too simple
Retype new password:
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
[root@PTUD-VM01-2 ~]# su - wccc
[wccc@PTUD-VM01-2 ~]$ pwd
/u01/wccc

Monday, August 24, 2015

Check connection to Linux server

Syntax:
traceroute -nT   -p
Example:
[root@ptud ~]# traceroute -nT 10.79.255.87 -p 22
traceroute to 10.79.255.87 (10.79.255.87), 30 hops max, 60 byte packets
 1  192.168.2.158  0.511 ms  1.071 ms  1.320 ms
 2  192.168.2.1  9.100 ms  9.121 ms  9.105 ms
 3  10.79.255.253  16.590 ms  16.575 ms  16.555 ms

 4  10.79.255.87  15.941 ms  15.818 ms  15.880 ms

Saturday, August 22, 2015

How to set security ssh on linux


[root@App1 ~]# vi /etc/ssh/sshd_config
### insert the command to apply only monitor, survey, oam user OS can ssh from anywhere, others ### cannot ssh from other machine
AllowUsers monitor survey oam

Now, Restart sshd
[root@App1 ~]# /etc/init.d/sshd restart
Stopping sshd:                                             [  OK  ]
Starting sshd:                                             [  OK  ]
[root@App1 ~]#

Thursday, July 23, 2015

How to fix error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory

[root@vcr-broadcast2 tmp]# rpm -q libgc
rpm: error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory
[root@vcr-broadcast2 tmp]#
[root@vcr-broadcast2 tmp]# export LD_LIBRARY_PATH=${prefix}/lib:$LD_LIBRARY_PATH

Wednesday, July 22, 2015

RPM to install packets for Redhat using option --nodeps

Install Packet
[root@vcr-broadcast2 setup]# rpm -ivh glibc-headers-2.21.90-18.fc24.i686.rpm 
error: Failed dependencies:
glibc = 2.21.90-18.fc24 is needed by glibc-headers-2.21.90-18.fc24.i686
kernel-headers is needed by glibc-headers-2.21.90-18.fc24.i686
kernel-headers >= 2.2.1 is needed by glibc-headers-2.21.90-18.fc24.i686
[root@vcr-broadcast2 setup]# rpm -ivh --nodeps glibc-headers-2.21.90-18.fc24.i686.rpm 
Preparing...                ########################################### [100%]
   1:glibc-headers          ########################################### [100%]
Uninstall packet.
[root@vcr-broadcast2 setup]# rpm -ev libstdc++-devel-5.1.1-4.fc23.i686
error: Failed dependencies:
libstdc++-devel = 4.4.4-13.el6 is needed by (installed) gcc-c++-4.4.4-13.el6.x86_64
[root@vcr-broadcast2 setup]# rpm -ev --nodeps libstdc++-devel-5.1.1-4.fc23.i686
[root@vcr-broadcast2 setup]#


Monday, July 20, 2015

Tuesday, July 14, 2015

Scripts see Memory Static every 5 seconds

[oracle@ptud1 PT8.54]$ more tho.sh
while true
do
free
echo "-----VTG-----------" $(date) "-----------------"
sleep 5
done
[oracle@ptud1 PT8.54]$ sh tho.sh
             total       used       free     shared    buffers     cached
Mem:       8062556    7894200     168356          0     104628    3922636
-/+ buffers/cache:    3866936    4195620
Swap:      8191992      48316    8143676
-----VTG----------- Tue Jul 14 16:58:48 ICT 2015 -----------------
             total       used       free     shared    buffers     cached
Mem:       8062556    7894588     167968          0     104636    3922636
-/+ buffers/cache:    3867316    4195240
Swap:      8191992      48316    8143676
-----VTG----------- Tue Jul 14 16:58:53 ICT 2015 -----------------
             total       used       free     shared    buffers     cached
Mem:       8062556    7894960     167596          0     104640    3922636
-/+ buffers/cache:    3867684    4194872
Swap:      8191992      48316    8143676
-----VTG----------- Tue Jul 14 16:58:58 ICT 2015 -----------------

Saturday, July 11, 2015

Simply Example of grep on linux

Do you want to find content of file on directory on linux?
I'd like to give you a simply command to do that.
Syntax:
grep -ril {content what you want to search} {path of the directory}
Example:




[oracle@ptud1 unix]$ grep -ril "grant select" .

./psroles.sql

./psroles.log

./connect.sql

./connect.log

./pdb/psroles2.sql

./pdb/connect.sql

[oracle@ptud1 unix]$