Linux Command

No one can remember all the Linux commands therefore, dbarepublic has created this page to store all the Linux commands that are frequently or rarely used commands. This page is updated whenever we solve problem using Linux command or utilities. This page lists everything that we have been using for our projects & assignments since year 2000. Remember, this is not a man page instead  a quick command reference to assist anyone with your database administration and development work.

Files: touch filename.txt vi filename.txt cat filename.txt view filename.txt rm filename.txt ls ls -lrt   ls  my* ls -a   ls -a | egrep searchfilename.txt  #searching hidden file   mv filename .hidefilename.txt     #hidden file
Directories: mkdir directoryname mkdir .hiddendirectory ls directoryname rm foldername        #empty folder rm -rf foldernamer   #folder that contains file 
No Hang Up: <nohup> nohup ./take_backup.ksh & nohup ./take_backup.ksh >spool.txt jobs                  #view background process or jobs fb %job#              #moving jobs from background to foreground ps -a | egrep pbaniya #list all jobs under user pbaniya ctrl + Z              #stops running script bg                    # moves the foreground job to background
No Hang UP:<nohup> SqlPlus Script:
nohup sqlplus username/password@oracledb @query_file.sql &
Head & Tail: head foo.txt          #display first ten lines tail foo.txt          #display last ten lines head -100 foo.txt     #displays first 100 lines tail -50 foo.txt      #displays last 50 lines
Less is More: cat foo.txt | more   #display one page at a time. cat foo.txt | less   #display one page at a time(more advanced)
Who,Which, & Whoami: who                  #who are logged into the system. which ssh            #displays the path of executables whoami               #current user name
Switch User: su username      #login in as substitue user
All User: awk -F ':' '{print $1}' /etc/passwd  #display all the users in the system
Cut:  cut -c4 foo.txt     #extract 4th character from each line  cut -c4-10 foo.txt  #extract from 4-10th character  cut -c4- foo.txt    #extract 4th character to end  cut -c-10 foo.txt   #extract start to 10th character  cut -d ':' -f1 foo.txt    #extract first field using  cut -d ':' -f1,6 foo.txt  #extract first and 6th fields
I/O Redirection: ls -lrt > foo.txt   #append the result to foo.txt ls -lrt >> foo.txt  #writes result to foo.txt with append sort < input.txt    #reads from input.txt sort < input.txt > foo.txt #sorted result to foo.txt sort <input.txt | more     #combines linux command
Linux Version: uname                #linux version uname -r             #linux version uname -a             #linux version cat /proc/version    #linux version lsb_release -a     #linux version
Host Information: hostname            #display host hostname -i         #display ip address hostname -a         #display full hostname cat /etc/hosts      #host files

1 comment

Powered by Blogger.