Hi Friend
Welcome to My Blog.I ve presented here list of Linux Commands which is useful for dbas on regular basis.Have a look !
Listing the Files and Directories.
ü ls
ü ls -a
Uname and Host Name
ü uname –a
ü hostname
Displays system statistics
ü vmstat 5 3
ü free -m
ü cpu
ü uptime
ü who
Moving or Renaming File names and Directories
ü mv file1 file2
ü mv file1 /d01/file2
Removing files and Directories
ü rm file1
ü rm –Rf <dirname> - Removes the files within the directory also
Finding Files and their locations
ü find -name ‘filename’
ü find -name '*' -size +1000k (searching any file i.e. 1000 above size)
Finding the How much Disk space used
ü du -sh
ü du -sh <filename>
Killing the Process
ü kill -9 <pid> <pid> <pid>
Changing the ownership and permissions of Files
ü chown newuser <filename>
ü chmod -R 777 /d01/filename
ü useradd <username> -Adding user
ü userdel -r <username> - For deleting the Existing User
To Record all your commands and output to a file
ü script <filename>
Networking Comands
ü ping <servername or ipaddress> -For server is up or not
ü tnsping <SID> -For sql*net connection is ok or not
Installing the Rpms
ü rpm -ivh <package name>
ü rpm -qa -for knowing list of packages
ü rpm -qa | grep <package name>
Printing Commands
ü $lpq -it shows the printer name and also whether it is ready or not
ü $lpstat -d - For finding the printer destination
ü cupsdisable<printer name> -For stopping the printer or classes
ü cupsenable<printer name> - starts the named printer or classes
VI Editor Commands
ü dd -Delete line
ü 3dd -Delete 3 lines.
ü dw -Delete word
ü 4dw -Delete 4 words
ü ESC -Terminate insert mode
ü u -Undo last change
ü U -Undo all changes to entire line
ü h/j/k/l -Move cursor left/down/up/right
ü spacebar -Move cursor right one space
ü ctrl-d -Scroll down one half of a page
ü ctrl-u -Scroll up one half of a page
ü ctrl-f -Scroll forward one page
ü ctrl-b -Scroll back one page
ü gg -for going to top of file
ü shift+g -For bottom of file
ü /word -For searching the word in Entire File
ü yy -For copying
ü 3yy -will copy 3 lines
ü p -For pasting
ü x10 -delete (cut) 10 characters
ü : u -undo last command
ü :%s/apple/ball/g - It searches and replaces all the occurrence of word apple with ball in the entire file
Monitoring Files in UNIX
ü cat /etc/passwd -users Info
ü cat /etc/group -Group info
ü cat /etc/sysctl.conf -Kernel info
ü cat /etc/hosts -hosts info
No comments:
Post a Comment