This is default featured slide 1 title
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.
This is default featured slide 2 title
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.
This is default featured slide 3 title
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.
This is default featured slide 4 title
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.
This is default featured slide 5 title
Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.
Sunday, 22 February 2009
Unix Interview Questions (Part1)
Monday, 2 February 2009
Unix Script to Automate FTP Process
Normally we come across the situation when we have to FTP file daily.Doing this process daily for large no of files can be cumbersome.We can create Unix script to automate FTP Process
Currently we need to last day files from production to dev box for testing,so we created below mentioned script to FTP files daily
b=`TZ=CST+24 date +%y%m%d` ###To get last date
cd /export/home/mydir
ftp -v -n FTP_HOST_NAME EOF ##Please put two less than sign before EOF
user Userid Pwd
bin
cd /export/home/source_dir
get FILE_NAME.`echo $b`
bye
EOF
Please note replace FTP_HOST_NAME,Userid,Pwd with your actual userid,password and ftp host name.
Please put two less than sign before EOF in third line of script as i am not able to display those characters due to some restrictions.
If you have further queries then please mail to support@itnirvanas.comFriday, 2 January 2009
Unix Handy Commands
These are the commands which i use on daily basis in Unix.I found these commands very useful
In point 2 and 6 it is not displaying pipe symbol due to some problem.Please use pipe between commands
- Too see a particular line For example if you just want to see 180th line in file sed -n '180p' testfile.txt
- To find a particular column in file cat testfile.txt awk -F"," '{print $2}'
- To rename file with current date mv test test_`date +%Y-%m-%d
- This command will take out all those lines which are having 8 at 17th position grep '^.\{16\}8' testfile.txt >testfile_new.txt
- To remove nth line without openning file sed 'nd' file1>file2 to remove multiple lines sed -e 1d -e 5d
- To find top 20 files with most spacels -ltrawk -F" " '{print $5 $9}' sort -ntail -20
- To find record in first file not in second comm -13 testfile1.txt testfile2.txt
- If you are looking from something that is contained in a file but you don't know which directory it is in do the following: find . -name "*" xargs grep -i something This will find all of the files in the directory and below and grep for the string something in those files!
- Delete Files Delete all the files starting with name testfile find . -type f -name "testfile*" exec rm -f {} \;
- Remove blank space from file sed -e "s/ *//g" testfile.txt >testfile.txt_wo_space










