This post shows a quick and easy way to use Linux commands on Windows in the Windows Terminal by using Windows Subsystem for Linux (WSL). Oracle Developers can - for example - use sqlcl from that environment.
First, install Windows Terminal from the Microsoft Store, or with winget if you have already installed it.
Windows Subsystem for Linux is a great way to have Linux functionality on Windows. For the first time usage, follow the Microsoft Documentation to install it. Oracle Linux 9 is available in the Microsoft Store as fully compatible, free RHEL/CentOS alternatives. That is a nice option, if you have to develop for RHEL, but want to save the license costs.
And SQLcl can easily installed, as long as you have Java on the system.
winget search 'oracle linux'
winget install 9MXQ65HLMC27
sudo dnf in java-17-openjdk.x86_64
sudo dnf in ncurses
sudo dnf in unzip.x86_64
Download latest SQLcl zip archive from https://download.oracle.com/otn_software/java/sqldeveloper/sqlcl-latest.zip and unzip it
wget https://download.oracle.com/otn_software/java/sqldeveloper/sqlcl-latest.zip unzip sqlcl-latest.zip
Add the path to the SQLcl binary to your .bashrc and source it. A cool feature of WLS is, that all your Windows drives are automatically mounted under /mnt/c, /mnt/d etc. So if you already have a network/admin directory under Windows, you can point your TNS_ADMIN to that location. Also set SQLPATH to enable some of the cool features of SQLcl. This is what my .bashrc ends with.
export PATH=/home/oracle/sqlcl/bin:$PATH export TNS_ADMIN=/mnt/d/Oracle/network/admin
export SQLPATH=~/sql
Create a directory ~/sql and inside a file named login.sql with the above content.
set statusbar on set highlighting on
That't it. Open an Oracle Linux 9 tab in your Windows Terminal and connect to all your databases via sqlcl
Or just take it to use all usual Linux commands in Windows.