Reference

Commands I've learned

A working reference of 183 terminal commands gathered while shipping real projects — git, Docker, nginx, SSH, deployment and more. Search it, filter it, copy it.

183 commands

crontab

Schedule automated tasks

crontab -e # Edit cron jobs
crontab -l # List cron jobs
0 2 * * * /usr/local/bin/backup.sh
backupintermediate#backup#automation#scheduling
tar

Create and extract tar archives

tar -czf backup.tar.gz /var/www # Create compressed backup
tar -xzf backup.tar.gz # Extract backup
backupintermediate#backup#archive#compression
apt install

Install packages using apt

sudo apt install -y nginx curl git
bashbeginner#linux#package-management#installation
apt update

Update package repository information

sudo apt update # Update package lists
bashbeginner#linux#package-management#ubuntu
apt upgrade

Upgrade installed packages

sudo apt upgrade -y # Upgrade all packages
bashbeginner#linux#package-management#ubuntu
cd

Change directory

cd /var/www # Absolute path
cd .. # Parent directory
bashbeginner#bash#navigation#directory
chmod

Change file permissions

chmod +x script.sh # Make executable
chmod 644 file.txt # Set specific permissions
bashintermediate#bash#permissions#security
chown

Change file ownership

sudo chown user:group file.txt # Change owner and group
bashintermediate#bash#ownership#permissions
ls

List directory contents

ls -la # Detailed list with hidden files
bashbeginner#bash#directory#listing
mkdir

Create directories

mkdir -p /var/www/app # Create with parent directories
bashbeginner#bash#directory#creation
Chrome cache clear

Clear browser cache and site data on macOS

Cmd + Shift + Delete # Chrome cache clear shortcut
chrome://settings/content/all # Site data management
browserbeginner#browser#cache#macos
Hard refresh

Force browser to reload ignoring cache

Cmd + Shift + R # macOS hard refresh
Ctrl + Shift + R # Windows/Linux hard refresh
browserbeginner#browser#refresh#cache
Safari cache clear

Clear Safari cache on macOS

Cmd + Option + E # Clear Safari cache
Safari → Develop → Empty Caches
browserbeginner#browser#safari#cache
mongo

Connect to MongoDB shell

mongo mongodb://localhost:27017/myapp
databasebeginner#mongodb#shell#nosql
mysqldump -u username -p database > backup.sql

Create MySQL database backup

mysqldump -u root -p myapp > backup.sql
databaseintermediate#mysql#backup#export
pg_dump database > backup.sql

Create PostgreSQL database backup

pg_dump myapp > backup.sql
databaseintermediate#postgresql#backup#dump
psql -U username -d database

Connect to PostgreSQL database

psql -U postgres -d myapp
databasebeginner#postgresql#connect#database
redis-cli

Connect to Redis server

redis-cli
databasebeginner#redis#cli#cache
./deploy.sh

Run automated deployment script

./deploy.sh # Execute deployment script with progress indicators
deploymentbeginner#deployment#automation#scripts
rsync -avz --progress --exclude 'node_modules' --exclude '.next' . forexuser@217.154.33.169:/var/www/fx-platform/

Sync project files to VPS excluding build artifacts

rsync -avz --progress --exclude 'node_modules' --exclude '.next' . forexuser@217.154.33.169:/var/www/fx-platform/
deploymentadvanced#rsync#deployment#file-sync
scp -P 2222 file.txt forexuser@217.154.33.169:/path/to/destination

Copy single file to VPS via SCP

scp -P 2222 Acuity-Final.mq5 forexuser@217.154.33.169:~/
deploymentbeginner#scp#file-transfer#ssh
SSH VPS connection

Connect to IONOS VPS with custom port

ssh -p 2222 forexuser@217.154.33.169 # Connect to DevHakim VPS
deploymentbeginner#ssh#vps#ionos
VPS deployment pipeline

Complete deployment process for VPS

cd /var/www/devhakim && git pull && npm install && npm run build && pm2 restart devhakim
deploymentintermediate#deployment#vps#git
docker --version

Check Docker version

docker --version
dockerbeginner#docker#version#info
docker build

Build Docker image from Dockerfile

docker build -t myapp:latest . # Build image with tag
dockerintermediate#docker#build#images
docker build -t image-name .

Build Docker image from Dockerfile

docker build -t my-app .
dockerintermediate#docker#build#image
docker exec -it container-id bash

Execute interactive bash in running container

docker exec -it abc123def456 bash
dockerintermediate#docker#exec#interactive
docker logs

View container logs

docker logs container-name # View logs
docker logs -f container-name # Follow logs
dockerbeginner#docker#logs#debugging
docker logs container-id

View container logs

docker logs abc123def456
dockerbeginner#docker#logs#debugging
docker ps

List running containers

docker ps # Running containers
docker ps -a # All containers
dockerbeginner#docker#containers#listing
docker run

Run container from image

docker run -p 3000:3000 myapp # Run with port mapping
dockerintermediate#docker#run#containers
docker run -p 3000:3000 image-name

Run container with port mapping

docker run -p 3000:3000 my-app
dockerintermediate#docker#run#ports
docker run hello-world

Run a test container to verify Docker installation

docker run hello-world
dockerbeginner#docker#run#test
docker stop container-id

Stop running container

docker stop abc123def456
dockerbeginner#docker#stop#management
docker system prune -a

Remove all unused containers, images, and networks

docker system prune -a
dockerintermediate#docker#cleanup#maintenance
docker-compose up

Start services defined in docker-compose.yml

docker-compose up -d # Start in detached mode
dockerintermediate#docker#compose#orchestration
docker-compose up -d

Start services defined in docker-compose.yml in background

docker-compose up -d
dockerintermediate#docker-compose#services#detached
git add

Stage changes for commit

git add . # Stage all changes
git add file.txt # Stage specific file
gitbeginner#git#staging#add
git add .

Stage all changes for commit

git add .
gitbeginner#git#staging#add
git branch

List, create, or delete branches

git branch feature/new-login # Create branch
git branch -d old-branch # Delete branch
gitintermediate#git#branch#workflow
git checkout

Switch branches or restore files

git checkout feature/new-login # Switch branch
git checkout -- file.txt # Restore file
gitintermediate#git#checkout#branch
git checkout -b branch-name

Create and switch to new branch

git checkout -b feature/user-profile
gitintermediate#git#checkout#branch-creation
git clone

Clone a repository from remote URL

git clone https://github.com/username/repo.git
gitbeginner#git#clone#repository
git clone <repository-url>

Clone a remote repository to local machine

git clone https://github.com/user/repo.git
gitbeginner#git#clone#remote
git commit

Commit staged changes

git commit -m "Add user authentication feature"
gitbeginner#git#commit#version-control
git commit -m "message"

Commit staged changes with a message

git commit -m "Add user authentication feature"
gitbeginner#git#commit#message
git init

Initialize a new Git repository

git init # Creates .git directory in current folder
gitbeginner#git#initialization#repository
git log

Show commit history

git log --oneline --graph --all -20
gitintermediate#git#history#log
git merge branch-name

Merge specified branch into current branch

git merge feature/user-authentication
gitintermediate#git#merge#integration
git pull

Fetch and merge remote changes

git pull origin main # Pull latest changes from main
gitbeginner#git#pull#merge
git pull origin main

Pull latest changes from remote repository

git pull origin main
gitbeginner#git#pull#sync
git push

Push commits to remote repository

git push origin main # Push to main branch
gitbeginner#git#push#remote
git push origin main

Push commits to remote repository

git push origin main
gitbeginner#git#push#remote
git reset --hard HEAD~1

Reset to previous commit and discard changes

git reset --hard HEAD~1
gitadvanced#git#reset#destructive
git stash

Temporarily save uncommitted changes

git stash save "work in progress"
gitintermediate#git#stash#temporary
git status

Show the working directory status

git status # Shows modified, staged, and untracked files
gitbeginner#git#status#working-directory
df -h

Show disk space usage

df -h # Disk usage in human readable format
monitoringbeginner#monitoring#disk#storage
free -h

Show memory usage in human readable format

free -h # Memory usage with MB/GB units
monitoringbeginner#monitoring#memory#system
htop

Interactive process viewer

htop # Better than top, interactive UI
monitoringbeginner#monitoring#processes#performance
iotop

Monitor disk I/O usage

sudo iotop # Real-time disk I/O monitoring
monitoringintermediate#monitoring#io#disk
kill PID

Kill process by process ID

kill 1234
monitoringbeginner#processes#kill#management
nethogs

Monitor network usage per process

sudo nethogs # Network usage by process
monitoringintermediate#monitoring#network#bandwidth
tail -f /var/log/nginx/error.log

Follow Nginx error logs in real-time

tail -f /var/log/nginx/error.log
monitoringintermediate#tail#logs#nginx
uptime

Show system uptime and load

uptime # System uptime and load average
monitoringbeginner#monitoring#uptime#load
whoami

Display current username

whoami
monitoringbeginner#system#user#info
xset q

Query X server settings and verify display connection

DISPLAY=:1 xset q
monitoringintermediate#x11#display#verification
sudo fuser -k 3001/tcp

Kill process using port 3001

sudo fuser -k 3001/tcp
networkintermediate#fuser#kill#ports
sudo lsof -i :3001

Check what's using port 3001

sudo lsof -i :3001
networkintermediate#lsof#ports#debugging
sudo ss -tlnp | grep :5000

Check what process is using port 5000

sudo ss -tlnp | grep :5000
networkintermediate#networking#ports#debugging
curl

Test HTTP endpoints

curl http://localhost:3001 # Test API
curl -I https://domain.com # Headers only
networkingbeginner#networking#http#testing
curl -k

Test HTTPS endpoints bypassing SSL verification

curl -k -I https://devhakim.com # Test HTTPS with insecure flag
networkingintermediate#networking#https#ssl
curl redirect test

Test HTTP to HTTPS redirects

curl -I http://devhakim.com # Check if HTTP redirects to HTTPS
networkingbeginner#networking#redirects#https
lsof -i

List processes using network ports

lsof -i :3001 # Check what's using port 3001
lsof -i tcp # All TCP connections
networkingintermediate#networking#ports#debugging
netstat -tlnp

Display network connections

sudo netstat -tlnp | grep :3002
networkingintermediate#networking#connections#monitoring
nslookup

Look up DNS information

nslookup domain.com # Check DNS resolution
networkingintermediate#networking#dns#troubleshooting
ss -tlnp

Show listening ports and processes

sudo ss -tlnp | grep :80 # Check port 80
sudo ss -tlnp | grep -E "3001|3002|5000"
networkingintermediate#networking#ports#monitoring
nginx -s reload

Send reload signal to Nginx master process

sudo nginx -s reload
nginxintermediate#nginx#signal#reload
nginx -t

Test nginx configuration

sudo nginx -t # Test configuration syntax
nginxintermediate#nginx#configuration#testing
systemctl reload nginx

Reload Nginx configuration without stopping

sudo systemctl reload nginx
nginxbeginner#nginx#reload#configuration
systemctl restart nginx

Restart nginx service

sudo systemctl restart nginx
nginxbeginner#nginx#service#restart
systemctl status nginx

Check nginx service status

sudo systemctl status nginx
nginxbeginner#nginx#service#status
tail -f /var/log/nginx/access.log

Follow Nginx access logs in real-time

tail -f /var/log/nginx/access.log
nginxintermediate#nginx#logs#monitoring
npm audit

Check for security vulnerabilities

npm audit # Show vulnerabilities
npm audit fix # Auto-fix issues
npmintermediate#npm#security#audit
npm cache clean --force

Clear npm cache to fix installation issues

npm cache clean --force
npmintermediate#npm#cache#troubleshooting
npm init

Initialize a new npm project

npm init -y # Skip questions and use defaults
npmbeginner#npm#initialization#package.json
npm install

Install dependencies from package.json

npm install # Install all dependencies
npm install express # Install specific package
npmbeginner#npm#install#dependencies
npm install --save-dev package-name

Install package as development dependency

npm install --save-dev nodemon
npmintermediate#npm#dev-dependencies#development
npm install package-name

Install a specific package

npm install express
npmbeginner#npm#install#package
npm list

List installed packages

npm list --depth=0 # Show top-level packages only
npmbeginner#npm#list#packages
npm run

Run scripts defined in package.json

npm run dev # Start development server
npm run build # Build for production
npmbeginner#npm#scripts#development
npm run script-name

Run npm script defined in package.json

npm run dev
npmbeginner#npm#scripts#automation
npm update

Update packages to latest versions

npm update # Update all packages
npm update express # Update specific package
npmintermediate#npm#update#maintenance
npx command

Execute package without installing globally

npx create-react-app my-app
npmintermediate#npx#execution#packages
npx create-next-app

Create new Next.js application

npx create-next-app@latest my-app --typescript --tailwind
npmbeginner#nextjs#react#initialization
pm2 delete

Delete PM2 applications

pm2 delete all # Delete all apps
pm2 delete api # Delete specific app
pm2intermediate#pm2#delete#cleanup
pm2 logs

View PM2 application logs

pm2 logs --lines 50 # Last 50 lines
pm2 logs api --lines 20 # Specific app
pm2beginner#pm2#logs#debugging
pm2 logs --lines 50

View PM2 logs with 50 lines

pm2 logs --lines 50
pm2beginner#pm2#logs#debugging
pm2 restart

Restart PM2 applications

pm2 restart all # Restart all apps
pm2 restart api # Restart specific app
pm2beginner#pm2#restart#management
pm2 save

Save PM2 process list

pm2 save # Save current process list
pm2intermediate#pm2#save#persistence
pm2 save && pm2 startup

Configure PM2 autostart on boot

pm2 save && pm2 startup
pm2intermediate#pm2#autostart#boot
pm2 start

Start application with PM2

pm2 start server.js --name "api" # Start with custom name
pm2intermediate#pm2#process-management#nodejs
pm2 start server.js --name "forexacuity-api"

Start API server with PM2

pm2 start server.js --name "forexacuity-api"
pm2intermediate#pm2#process-management#api
pm2 startup

Generate startup script for PM2

pm2 startup # Auto-start PM2 on system boot
pm2intermediate#pm2#startup#boot
pm2 status

Show all PM2 processes

pm2 status # List all running processes
pm2beginner#pm2#status#monitoring
pm2 stop

Stop PM2 applications

pm2 stop all # Stop all apps
pm2 stop api # Stop specific app
pm2beginner#pm2#stop#management
pip freeze

List installed packages with versions

pip freeze > requirements.txt # Export to file
pythonbeginner#python#pip#requirements
pip freeze > requirements.txt

Export installed packages to requirements file

pip freeze > requirements.txt
pythonintermediate#pip#requirements#export
pip install

Install Python packages

pip install fastapi # Install specific package
pip install -r requirements.txt # Install from file
pythonbeginner#python#pip#packages
pip install package-name

Install Python package using pip

pip install requests
pythonbeginner#pip#install#packages
pytest

Run Python tests with pytest

pytest tests/
pythonintermediate#testing#pytest#quality
python --version

Check Python version

python --version
pythonbeginner#python#version#info
python -c "import sys; print(sys.path)"

Check Python path configuration

python -c "import sys; print(sys.path)"
pythonadvanced#python#path#debugging
python -m http.server 8000

Start simple HTTP server

python -m http.server 8000
pythonintermediate#http#server#development
python -m pip install --upgrade pip

Upgrade pip to latest version

python -m pip install --upgrade pip
pythonintermediate#pip#upgrade#maintenance
python -m uvicorn

Run FastAPI server with uvicorn

python -m uvicorn main:app --reload --port 5000
pythonintermediate#python#fastapi#server
python -m venv

Create Python virtual environment

python -m venv venv && source venv/bin/activate
pythonbeginner#python#virtual-environment#setup
python -m venv venv

Create virtual environment

python -m venv venv
pythonintermediate#venv#virtual-environment#isolation
python script.py

Run Python script

python app.py
pythonbeginner#python#execution#script
source venv/bin/activate

Activate virtual environment

source venv/bin/activate # Linux/macOS
venv\Scripts\activate # Windows
pythonbeginner#python#virtual-environment#activation
certbot --nginx -d forexacuity.co.uk -d www.forexacuity.co.uk

Install SSL certificates with Certbot

sudo certbot --nginx -d forexacuity.co.uk -d www.forexacuity.co.uk
securityintermediate#certbot#ssl#https
fail2ban-client

Manage fail2ban intrusion prevention

sudo fail2ban-client status # Show jail status
sudo fail2ban-client status sshd
securityadvanced#security#intrusion-prevention#ssh
ufw

Uncomplicated Firewall management

sudo ufw enable # Enable firewall
sudo ufw allow 80/tcp # Allow HTTP
securityintermediate#security#firewall#ports
ufw allow 2222/tcp

Allow SSH on custom port through firewall

sudo ufw allow 2222/tcp
securitybeginner#ufw#firewall#ssh
ufw allow 80/tcp && ufw allow 443/tcp

Allow HTTP and HTTPS through firewall

sudo ufw allow 80/tcp && sudo ufw allow 443/tcp
securitybeginner#ufw#firewall#http
ufw status

Check firewall status and rules

sudo ufw status verbose # Detailed firewall status
securitybeginner#security#firewall#status
rsync

Synchronize files between local and remote

rsync -avz --progress -e "ssh -p 2222" local/ user@server-ip:/remote/
sshadvanced#ssh#sync#backup
scp

Secure copy files over SSH

scp -P 2222 local-file.txt user@server-ip:/remote/path/
sshintermediate#ssh#file-transfer#scp
ssh

Connect to remote server via SSH

ssh user@server-ip # Basic connection
ssh -p 2222 user@server-ip # Custom port
sshbeginner#ssh#remote#connection
ssh -L 5901:localhost:5900 -p 2222 -N forexuser@217.154.33.169 &

Create SSH tunnel for VNC access

ssh -L 5901:localhost:5900 -p 2222 -N forexuser@217.154.33.169 &
sshintermediate#ssh#tunnel#vnc
ssh -p 2222 forexuser@217.154.33.169

Connect to VPS via SSH on custom port

ssh -p 2222 forexuser@217.154.33.169
sshbeginner#ssh#vps#remote-access
ssh-copy-id

Copy SSH public key to remote server

ssh-copy-id -i ~/.ssh/id_ed25519.pub user@server-ip
sshintermediate#ssh#keys#authentication
ssh-keygen

Generate SSH key pair

ssh-keygen -t ed25519 -C "your-email@example.com"
sshintermediate#ssh#keys#security
ssh-keygen -t ed25519 -C "email@example.com"

Generate SSH key for secure access

ssh-keygen -t ed25519 -C "hakim@devhakim.com"
sshbeginner#ssh#security#authentication
certbot

Generate SSL certificates with Let's Encrypt

sudo certbot --nginx -d domain.com -d www.domain.com
sslintermediate#ssl#certificates#security
certbot --reinstall

Reinstall SSL certificate and fix nginx configuration

sudo certbot --nginx -d devhakim.com -d www.devhakim.com --reinstall
sslintermediate#ssl#certificates#nginx
certbot certificates

List installed SSL certificates

sudo certbot certificates # Show all certificates
sslintermediate#ssl#certificates#management
certbot renew

Renew SSL certificates

sudo certbot renew --dry-run # Test renewal
sudo certbot renew --quiet # Renew silently
sslintermediate#ssl#renewal#automation
openssl s_client

Check SSL certificate details and validation

echo | openssl s_client -connect devhakim.com:443 -servername devhakim.com 2>/dev/null | openssl x509 -noout -subject -dates
ssladvanced#ssl#certificates#validation
systemctl list-timers

Check systemd timers including SSL auto-renewal

systemctl list-timers | grep certbot # Check certbot auto-renewal status
sslintermediate#ssl#systemd#automation
apt update && apt upgrade -y

Update system packages

sudo apt update && sudo apt upgrade -y
systembeginner#apt#system-update#ubuntu
cat filename

Display file contents

cat package.json
systembeginner#files#text#display
cd /path/to/directory

Change directory to specified path

cd /var/www/fx-platform
systembeginner#navigation#directory#basics
chmod +x filename

Make file executable

chmod +x ~/start-mt5.sh
systembeginner#permissions#files#executable
cp source destination

Copy files or directories

cp .env.example .env.local
systembeginner#files#copy#basics
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -

Add Node.js repository

curl -fsSL https://deb.nodesource.com/setup_18.x | sudo bash -
systemintermediate#nodejs#repository#installation
dpkg --add-architecture i386

Enable 32-bit architecture for Wine

sudo dpkg --add-architecture i386
systemintermediate#dpkg#architecture#wine
export DISPLAY=:1

Set display environment variable for X11 applications

export DISPLAY=:1
systemintermediate#environment#display#x11
grep "pattern" filename

Search for text pattern in files

grep "error" /var/log/nginx/error.log
systembeginner#search#text#debugging
ls -la

List all files and directories with detailed info

ls -la
systembeginner#navigation#files#listing
mkdir -p /path/to/directory

Create directory and parent directories if needed

mkdir -p ~/Downloads/installers
systembeginner#files#directory#creation
mv source destination

Move or rename files and directories

mv old-file.txt new-file.txt
systembeginner#files#move#rename
nano filename

Edit file with nano text editor

nano .env.local
systembeginner#editor#text#configuration
pkill -f wine

Kill all processes containing "wine" in command line

pkill -f wine
systemintermediate#processes#kill#wine
pwd

Print working directory (show current location)

pwd
systembeginner#navigation#basics#directory
rm -rf directory

Remove files and directories recursively

rm -rf node_modules/
systembeginner#files#delete#recursive
wget https://download.mql5.com/cdn/web/metaquotes.software.corp/mt5/mt5setup.exe

Download MT5 installer from official source

wget https://download.mql5.com/cdn/web/metaquotes.software.corp/mt5/mt5setup.exe
systembeginner#download#mt5#installer
which command

Find location of command executable

which node
systembeginner#system#path#commands
journalctl

View service logs

sudo journalctl -u nginx -f # Follow logs
sudo journalctl -u nginx --since "10 minutes ago"
systemdintermediate#systemd#logs#debugging
journalctl -u mt5 -f

Follow MT5 service logs in real-time

journalctl -u mt5 -f
systemdintermediate#journalctl#logs#systemd
systemctl daemon-reload

Reload systemd configuration

sudo systemctl daemon-reload # After editing service files
systemdintermediate#systemd#reload#configuration
systemctl enable

Enable service to start on boot

sudo systemctl enable nginx
systemdintermediate#systemd#services#boot
systemctl enable x11-virtual

Enable X11 virtual display service

sudo systemctl enable x11-virtual
systemdintermediate#systemctl#x11#display
systemctl start

Start a service

sudo systemctl start nginx
systemdbeginner#systemd#services#start
systemctl stop

Stop a service

sudo systemctl stop nginx
systemdbeginner#systemd#services#stop
crontab -l

List user cron jobs

crontab -l 2>/dev/null | grep certbot # Check certbot cron jobs
troubleshootingintermediate#troubleshooting#cron#automation
fuser

Find and kill processes using files/ports

sudo fuser -k 3001/tcp # Kill processes using port 3001
troubleshootingintermediate#troubleshooting#ports#processes
groups

Check user group membership

groups # Show current user groups
groups username # Show specific user groups
troubleshootingbeginner#troubleshooting#permissions#users
kill

Terminate processes by PID

kill -9 1234 # Force kill process
kill $(lsof -t -i:3001) # Kill process on port
troubleshootingintermediate#troubleshooting#processes#kill
ps aux

List all running processes

ps aux | grep node # Find Node.js processes
ps aux | head -20
troubleshootingbeginner#troubleshooting#processes#monitoring
ps aux | grep

Find specific processes by name

ps aux | grep nginx # Find nginx processes
ps aux | grep node # Find Node.js processes
troubleshootingbeginner#troubleshooting#processes#filtering
tail -f

Follow log files in real-time

tail -f /var/log/nginx/error.log # Follow nginx errors
tail -f app.log
troubleshootingbeginner#troubleshooting#logs#monitoring
DISPLAY=:1 xdpyinfo | head -5

Test X11 display connection

DISPLAY=:1 xdpyinfo | head -5
vncintermediate#xdpyinfo#x11#testing
x11vnc -display :1 -nopw -forever -shared -rfbport 5900 &

Start VNC server on virtual display

x11vnc -display :1 -nopw -forever -shared -rfbport 5900 &
vncadvanced#x11vnc#vnc#remote-desktop
Xvfb :1 -screen 0 1024x768x24 -ac +extension GLX +render -noreset &

Start virtual X display for headless GUI apps

Xvfb :1 -screen 0 1024x768x24 -ac +extension GLX +render -noreset &
vncadvanced#xvfb#x11#virtual-display
xwininfo -root -tree

Display X11 window tree and hierarchy

DISPLAY=:1 xwininfo -root -tree
vncadvanced#x11#windows#debugging
DISPLAY=:1 wine ~/.wine/drive_c/Program\ Files/MetaTrader\ 5/terminal64.exe

Start MT5 with virtual display

DISPLAY=:1 wine ~/.wine/drive_c/Program\ Files/MetaTrader\ 5/terminal64.exe
wineadvanced#wine#mt5#display
rm -rf /home/forexuser/.cache/winetricks

Clear Winetricks cache to fix dependency issues

rm -rf /home/forexuser/.cache/winetricks
wineintermediate#winetricks#cache#cleanup
wine

Run Windows applications in Wine

wine setup.exe # Run Windows installer
DISPLAY=:1 wine terminal64.exe
wineintermediate#wine#windows#applications
wine reg add "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion" /v CurrentVersion /t REG_SZ /d "10.0" /f

Configure Wine to emulate Windows 10

wine reg add "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion" /v CurrentVersion /t REG_SZ /d "10.0" /f
wineadvanced#wine#registry#windows-emulation
winecfg

Configure Wine settings

winecfg # Open Wine configuration GUI
wineintermediate#wine#configuration#windows
wineserver -k

Stop Wine server and terminate all Wine processes

wineserver -k
wineintermediate#wine#server#kill
winetricks

Install Windows dependencies in Wine

winetricks corefonts vcrun2019 # Install common dependencies
wineintermediate#wine#dependencies#windows
winetricks corefonts vcrun2019 msxml6 msxml3

Install Windows dependencies for MT5

winetricks corefonts vcrun2019 msxml6 msxml3
wineintermediate#winetricks#dependencies#mt5