We are not Unix admin but we have to know some basic commands as a dba. In this post i try to share some of most usefully command for Unix based system.

Here is the some usage and examples

The following is a list of commonly used Unix commands:

  • ps – Show process
  • grep – Search files for text patterns
  • mailx – Read or send mail
  • cat – Join files or display them
  • cut – Select columns for display
  • awk – Pattern-matching language
  • df – Show free disk space
  • ls – List of files
  • wc – Count of files
  • mv – Move command (ctrl+x command on windows)
  • cp – Copy command

Here are some examples of how the DBA uses these commands:

List available instances on a server:

ps -ef | grep smon or $ ps -ef | grep pmon

List available listeners on a server:

ps -ef | grep listener or ps -ef | grep listener | grep -v grep

List number of lines in the alert.log file:

cat alert.log | wc -l

List number of files in folder:

ls -l |wc -l

List files under folder:

ls -lart