Posts

Showing posts from August, 2011

Remove Control M characters from a file in UNIX

Open file in putty and execute the following command :%s,^VM,,g <------------ to remove ctrl m characters

To find Solaris version

1) cat /etc/*release 2) uname -a

To Verify ML versions

Following commands will give the ML versions in AIX 1) instfix -i | grep ML 2) oslevel -r

Find command in UNIX

Find text in the current folder and redirect output to OP1.txt find . -name "*" -exec grep "FIND THIS TEXT" {} \;>> OP1.txt Find text in the current folder and print the output on screen grep "FIND THIS TEXT" `find .` |cut -d":" -f1 | grep -v properties | sort -u find the text and print the file name along with the path on screen find xxxxxPATH_TO_SEARCHxxxxxx -type f -exec grep -l 'FIND THIS TEXT' {} \;

Update a column of a table with random values

Query to update a column of a table with random values within a range of 1 to 21 UPDATE <%table_name%> SET <%column_name%> = trunc(dbms_random.value(2,21))