Friday, June 4, 2010

Useful Unix-Linux commands for apps DBA’s

  • Search a word on a text(s)
find . -type f -name “*.txt” -exec grep XXWW {} \; -print

  • Number of files in a directory:
ls -l | wc -l

  • Kill all processes of a user (be careful !)
kill `ps -fu username | awk ‘NR != 1 {print $2}’`

  • Find a file under current directory and subdirectories
find . -name “*.trc”

  • Find files older than XX days (60 days)
find . -name “*.trc” -mtime +60

  • Find files older than XX days and move them to another directory.
find . -name “*.trc” -mtime +60 -exec mv {} /data1/test \

  • Find files older than XX days and delete them all (be careful)
find . -name “*.trc” -mtime +60 -exec rm {} \;

  • Runing Apache services
ps -ef|grep apache

  • Running Concurrent processes
ps -ef|grep FNDLIBR*|grep user

  • Running forms services
ps -ef|grep f60*|grep user

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.