August 2014
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

Categories

August 2014
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031

ls

I always find it difficult to digest the filesize from the ls -al command. For instance, after ls -al, the output give me filesize in bytes.

Gosh, then I have to start calculating it by taking last 4 digits, slowly count upwards like 1K, 10K, 100K, 1MB, 10MB, 100MB and so on so forth.

For […]

find shell

Find files larger than 100MB…

find . -size +100000000c -ls Old Files Find files last modified over 30days ago…

find . -type f -mtime 30 -ls Find files last modified over 365days ago…

find . -type f -mtime 365 -ls Find files last accessed over 30days ago…

find . -type f -atime 30 -ls Find […]

Shell good reference

The Bourne shell (/bin/sh) is present on all Unix installations and scripts written in this language are (quite) portable; man 1 sh is a good reference. Basics

Variables and arguments

Assign with variable=value and get content with $variable MESSAGE=”Hello World” # Assign a string PI=3.1415 # Assign a decimal number N=8 TWON=`expr $N * 2` […]

Date and time calculation functions using AWK

awk has 3 functions to calculate date and time: systime strftime mktime Let us see in this article how to use these functions:

systime: This function is equivalent to the Unix date (date +%s) command. It gives the Unix time, total number of seconds elapsed since the epoch(01-01-1970 00:00:00). $ echo | awk ‘{print systime();}’ […]

Install Java 1.8 and tomcat 8 on Redhat 7 centos 7

mkdir software

64 BIT # wget –no-cookies –no-check-certificate –header “Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie” “http://download.oracle.com/otn-pub/java/jdk/8u40-b25/jdk-8u40-linux-x64.tar.gz”

# tar xzf jdk-8u40-linux-x64.tar.gz 32 BIT # wget –no-cookies –no-check-certificate –header “Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie” “http://download.oracle.com/otn-pub/java/jdk/8u40-b25/jdk-8u40-linux-i586.tar.gz”

 

wget –no-cookies –no-check-certificate –header “Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie” “http://download.oracle.com/otn-pub/java/jdk/8u60-b27/jdk-8u60-linux-x64.tar.gz”

 

# tar xzf jdk-8u40-linux-i586.tar.gz mkdir /usr/java/

cd /usr/java/jdk1.8.0_40/ [root@cluster1 java]# ln -s /usr/java/jdk1.8.0_40/bin/java /usr/bin/java [root@cluster1 java]# alternatives […]

Red Hat Enterprise Linux 6 to 7

Red Hat Enterprise Linux 6 to 7? Migrating existing Red Hat Enterprise Linux installations to new major versions

Migration vs. Upgrade •migration: Moving a set of running services from one installed system to another, including all configuration aspects and data. •upgrade: Upgrading the installed software to newer revisions. This process may or may not include […]