Basic Linux Commands for Oracle DBA with Examples, Definitions, and Descriptions. A list of basic linux commands for Oracle DBA, along with examples, definitions, and descriptions.
ls command in linux:
Definition: List directory contents.
Description: Linux ls command is used to display the files and directories in the present working directory. You can add options like ls -l, ls -ltr, ls -lrt, ls -la etc to get detailed information, including file size, modification, permissions and ownership.
Examples:
$ ls
$ ls -l /home/oracle
cd command in linux:
Definition: Change directory.
Description: Linux cd command is used to get inside files, mount points, directories, etc. You just need to specify the relative path of the directory.
Examples:
$ cd /u01/app/oracle,
$ cd ..
pwd command in linux:
Definition: Print working directory.
Description: Linux pwd command displays the current working directory. And to add -P option to show the physical path.
Examples:
$ pwd
$ pwd -P
cp command in linux:
Definition: Copy files or directories.
Description: Linux cp command is used to make copy of files or directories.
Examples:
$ cp file1 file2
$ cp -r /source_directory /destination_directory
mv command in linux:
Definition: Move or rename files or directories.
Description: Linux mv command moves files or directories to a new location or renames files or directories.
Examples:
$ mv file1 /path/new_location
$ mv old_file_name new_file_name
rm command in linux:
Definition: Remove files or directories.
Description: The linux rm command is used to delete files or directories or to add -rf option to delete them permanently.
Examples:
$ rm file1
$ rm -rf directory
mkdir command in linux:
Definition: Make directories.
Description: The linux mkdir command creates new directories. And as needed, you can use -p to create parent directories with specified directory path.
Examples:
$ mkdir new_directory
$ mkdir -p /path/new_directory
rmdir command in linux:
Definition: Remove directories.
Description: Linux rmdir command deletes empty directories. And add the -p option for recursive deletion of parent directories.
Examples:
$ rmdir empty_directory
$ rmdir -p /path/parent_directory
chmod command in linux:
Definition: Change file permissions.
Description: Linux chmod command modifies file and directory permissions with a specified numeric mode (755) or symbolic mode (u+x).
Examples:
$ chmod 755 script.sh
$ chmod u+x file
chown command in linux:
Definition: Change file owner and group.
Description: Linux chown command changes the ownership and group of files or directories with -R option for recursive.
Examples:
$ chown oracle:dba file
$ chown -R oracle:dba directory
ps command in linux:
Definition: Process status.
Description: Linux ps command displays information about running processes to add option -ef to provide a detailed list of all processes and grep to filter the files.
Examples:
$ ps
$ ps -ef | grep ora
top command in linux:
Definition: Display system resource usage.
Description: Linux top command shows real-time system resource usage, including CPU, memory, and swap space. Adding options allows filtering processes by user, such as -u oracle.
Examples:
$ top
$ top -u oracle
grep command in linux:
Definition: Search for patterns in files.
Description: Linux grep command searches for a specified pattern in one or more files and adds the option -r for recursive.
Examples:
$ grep pattern file
$ grep -r pattern directory
tail command in linux:
Definition: Display the last part of a file.
Description: Linux tail command shows some lines of a file. And add the option -n or -f to allow specifying the number of lines to display.
Examples:
$ tail file
$ tail -n 20 file
head command in linux:
Definition: Display the first part of a file.
Description: Linux head command shows the first few lines of a file. And to add options -n or -f to allow specifying the number of lines to display.
Examples:
$ head file
$ head -n 10 file
vi or vim command in linux:
Definition: Text editor.
Description: Linux vi and vim are text editors in Linux. To create and edit text files directly from the command line.
Examples:
$ vi filename
$ vim + filename
ssh command in linux:
Definition: Secure Shell.
Description: The linux ssh command allows you to connect to a remote server or host. You just specify the username and hostname to connect. And to add the -p option to specify a custom SSH port.
Examples:
$ ssh root@prodd
$ ssh -p port root@proddb
scp command in linux:
Definition: Secure Copy.
Description: Linux scp command securely copy the files or directories between local host and remote hosts over an SSH connection.
Examples:
$ scp file root@proddb:/path/destination
$ scp -r directory root@proddb:/path/destination
tar command in linux:
Definition: Tape archive.
Description: The Linux tar command is to create and extract tar archive files. Options like -c to create, -x to extract, and -v to provide verbose output.
Examples:
$ tar -cvf archive.tar file1 file2
$ tar -xvf archive.tar
crontab command in linux:
Definition: Cron table.
Description: Linux crontab command allows you to create, edit, list, and remove cron jobs with option to Use -e to edit tables and -l to list existing files.
Examples:
$ crontab -e
$ crontab -l
du command in linux:
Definition: Disk usage.
Description: Linux du command displays disk usage of files and directories. To add the options -h to provides human-readable output, and -s to list the total disk usage.
Examples:
$ du -h /path/directory
$ du -sh *
df command in linux:
Definition: Disk free.
Description: Linux df command is to displays filesystem disk space usage with add Options -h to provide human-readable output.
Examples:
$ df -h
$ df -i
free command in linux:
Definition: Memory usage.
Description: Linux free command to show system memory usage. Option -m displays the memory in megabytes.
Examples:
$ free
$ free -m
uptime command in linux:
Definition: System uptime.
Description: Linux uptime command to display system uptime. Option -p provides a more readable format.
Examples:
$ uptime
$ uptime -p
netstat command in linux:
Definition: Network statistics.
Description: Linux netstat command to display network connections. To use option -tuln to show listening ports.
Examples:
$ netstat -tuln
$ netstat -an | grep LISTEN
ifconfig or ip command in linux:
Definition: Network interface configuration.
Description: Linux ifconfig command to display and configure network interface.
Examples:
$ ifconfig
$ ip addr show
ping command in linux:
Definition: Test network connectivity.
Description: Linux ping command to send requests to a host to test network connectivity. To use option -c to specify the number of packets to send.
Examples:
$ ping hostname
$ ping -c 5 hostname
traceroute or tracepath command in linux:
Definition: Trace route to destination.
Description: Linux tracerouteor tracepath to Trace the route packets and send to a destination host.
Examples:
$ traceroute hostname
$ tracepath hostname
nmap command in linux:
Definition: Network mapper.
Description: Linux nmap command to scans hosts and services on a network. To use option -p to specify port ranges to scan.
Examples:
$ nmap hostname
$ nmap -p 1-1000 hostname
iptables command in linux:
Definition: IP tables.
Description: Linux iptables command to configures packet filter rule in the Linux kernel framework for firewall, NAT, and packet.
Examples:
$ iptables -L
$ iptables -A INPUT -s 192.168.1.0/24 -j DROP
hostname command in linux:
Definition: Print or set system hostname.
Description: Linux hostname command to display the system’s hostname. To use option -f to show the domain name.
Examples:
$ hostname
$ hostname -f
date command in linux:
Definition: Print or set system date and time.
Description: Linux date command to display the current system date and time. To use option -u to show Universal Time (UTC).
Examples:
$ date
$ date -u
who command in linux:
Definition: Print information about logged-in users.
Description: Linux who command to display information about users logged into the system. To use option -u to show idle time.
Examples:
$ who
$ who -u
history command in linux:
Definition: Command history.
Description: Linux history command to display previously executed list commands. It Can be used to recall and re-run.
Examples:
$ history
$ history | grep command
shutdown command in linux:
Definition: Shutdown or restart the system.
Description: Linux shutdown command to Initiate a system shutdown. To use option -h now to shutdown immediately and option -r +10 “message” to restart in 10 minutes with a specified message.
Examples:
$ shutdown -h now
$ shutdown -r +10 “System maintenance”
These basic linux commands for Oracle DBA with examples cover a wide range of basic operations for beginners to use like touch, grep, tail, top, free, scp, ifconfig, history, etc tasks and are essential for managing and troubleshooting Linux systems.
Read More
Best Linux Commands For Beginners
Top 10 Linux Commands with Examples
Top 20 Linux Commands with Examples
Top 30 Linux Commands with Examples
Top 40 Linux Commands with Examples
Top 50 Linux Commands with Examples
Top 100 Linux Commands with Examples, Definitions, and descriptions