Home > installation > unix scripts – hints

unix scripts – hints

This section lists a some usefull unix commands and sample


  • find files with specific content
    find . -atime +30 -exec grep -il “abc” {} \;
  • find files  with special pattern and access-time
    find . -name “*tr?” -atime +3
    and delete those
    find . -name “*tr?” -atime +2  -delete
  • looping n-times

    I=1
    while test $I -le 100
    do
    sqlplus /nolog @script
    I=`expr $I + 1`
    Done

  • remove blank / empty lines from file
           grep -v "^$" filename > newfilename
  • convert UPPER to lower case
    host=`hostname`
    lhost =$(echo $host | tr [:upper:] [:lower:])
Advertisements
Categories: installation
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: