Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Sunday, May 20, 2012

Delete N number of lines from a file on Linux

$ sed -i 'starting_line_no, end_line_no d' file_name

$ sed -i '1,5d' test.txt

The above command will delete first 5 lines from 'test.txt' file.

Wednesday, March 28, 2012

MOUNT CIFS STORAGE DRIVE IN LINUX

1. Login to Linux box as root user
2. Check if you can ping the external network attached storage
    $ ping x.x.x.x (IP)

3. Create a directory in Linux on which you want to mount this external storage
    $ cd /
    $ mkdir xyz

4. Issue the following command
    $ mount -t cifs -o username=xxxxx,password=********   //1.2.3.4/abc   /xyz
   
Where 1.2.3.4 is IP of storage (replace it with you actual IP), "/abc" is the folder that we want to mount and "/xyz" is the local folder that we have created in setp 3.

OR

Make an entry in fstab so that this may be mounted automatically on server boot.

$ vi /etc/fstab

$ //1.2.3.4/abc   /xyz  cifs username=xxxxxx,password=***********    0    0

Delete large number of files in Linux

$ cd target dir

$ find -mtime +20 -exec rm -rf {} \;

It will delete all the files and sub-directories in target directoy which were modified more than 20 days  ago

Count number of files in a directory in Linux

$ ls -1 | wc -l

Wednesday, March 14, 2012

HOW TO KILL A PROCESS

$ kill -9 process_id

HOW TO CHECK CONCURRENT MANAGER SESSIONS

$ ps -ef | grep FNDLIBR

HOW TO COMPILE A 10g FORM ON LINUX

/oracle/apps/tech_st/10.1.2/bin/frmcmp_batch
module=<complete path of form file name .fmb> userid=APPS/<APPS password \
output_file=<complete path of form file name .fmx> module_type=form \
batch=yes compile_all=special

CHECK IF ALL THE MIDDLE TEIR SERVICES ARE UP AND RUNNING

Login to apps tier node.
Source the apps tier environment file and run.

$ adopmnctl.sh status -l

Check the status of OC4J:oafm, OC4J:forms, OC4J:oacore and
HTTP_Server process and it should return 'Alive' against all.