تخطي للذهاب إلى المحتوى

The Ubuntu Command Directory

Linux commands directory, odoo ubuntu, Ollama AI local hosting
26 مارس 2026 بواسطة
The Ubuntu Command Directory
Account Manager

Navigation & File Essentials

The foundation for any user. These commands are for moving through the filesystem and managing data.

CommandActionPro Tip
pwdPrint Working DirectoryConfirms exactly where you are in the tree.
ls -lahList all files (human-readable)Shows hidden files and file sizes clearly.
cd -Go to previous directoryInstantly jumps back to your last location.
cp -rCopy directory recursivelyEssential for backing up folders.
mvMove or RenameLinux uses the same command for both.
rm -rfForce delete (Careful!)Deletes a directory and everything inside it.

System Intelligence & Hardware


For checking resources, hardware specs, and system health.

  • htop: An interactive process viewer (superior to top). Use it to kill "zombie" processes.

  • df -h: Displays disk space usage in a format humans can actually read (GB/MB).

  • free -m: Checks available RAM in Megabytes.

  • lscpu: Provides a detailed breakdown of your CPU architecture.

  • uptime: Shows how long the system has been running and the load average.

Permissions & Security


Ubuntu relies heavily on the sudo (SuperUser DO) logic.

  • sudo !!: Re-runs the last command with root privileges (a massive time-saver).

  • chmod 755 [file]: Sets standard permissions (Read/Write/Execute for owner, Read/Execute for others).

  • chown user:group [file]: Changes file ownership.

  • ufw status: Checks the "Uncomplicated Firewall" status.

  • lsblk: Lists all block devices (useful before mounting a USB or new drive).

Android & Ubuntu Integration


Bridge the gap between your mobile device and your desktop for a seamless workflow.

GUI & System Integration (KDE Connect / GSConnect)

The gold standard for integration. It allows you to sync notifications, share clipboards, and use your phone as a remote touchpad.

  • Install (Ubuntu/GNOME): sudo apt install gnome-shell-extension-gsconnect

  • Features:

    • Shared Clipboard: Copy text on Android, paste on Ubuntu.

    • Multimedia Control: Pause your PC music from your phone.

    • File Transfer: Right-click any file in Nautilus to "Send to Mobile."

High-Performance Screen Casting (Scrcpy)

scrcpy is the fastest, lowest-latency way to "cast" and control your Android screen via USB or WiFi. It requires USB Debugging to be enabled in Android Developer Options.

CommandActionPro Tip
sudo apt install scrcpyInstall ToolWorks out of the box on most Ubuntu versions.
scrcpyStart CastingConnect via USB and run to see your screen.
scrcpy -wStay AwakePrevents the Android device from sleeping.
scrcpy --no-audioVideo OnlyReduces latency if you don't need sound.
scrcpy --record file.mp4Screen RecordRecords the phone screen directly to your PC.

Export to Sheets

Wireless File Sharing (Warpinator / LocalSend)

If you don't want to use a cable or set up full integration, use these "AirDrop-style" tools.

  • LocalSend (Recommended): Open-source, cross-platform, and requires no setup. It detects devices on the same WiFi instantly.

  • Install: Available via Flatpak: flatpak install flathub org.localsend.localsend_app

Mobile Developer & Power User Tools


For those managing files or sideloading apps via the terminal.

  • sudo apt install adb fastboot: Installs the Android Debug Bridge.

  • adb devices: Lists all connected Android hardware.

  • adb push [file] /sdcard/: Sends a file from Ubuntu to your phone's internal storage.

  • adb pull /sdcard/[file] .: Grabs a file from your phone and saves it to your current Ubuntu directory.

  • adb install [app].apk: Sideloads an application directly from your PC.

Troubleshooting Tip: If your device isn't detected, check your USB cable (some are "charge only") and ensure you've accepted the "Allow USB Debugging" prompt on your phone's screen.

Advanced Text Processing & Search


Crucial for logs, configuration files, and developers.

The "Big Three" of Text:

  • grep "pattern" file: Searches for text within a file.

  • awk: Best for processing data in columns or tables.

  • sed: A stream editor used to find and replace text within files without opening them.

  • find . -name "*.conf": Finds all configuration files in the current directory and subdirectories.

  • tail -f /var/log/syslog: Watches a log file in real-time as new data is written.

Package Management (apt)


The heart of Ubuntu's "Smart Directory" logic.

Bash

sudo apt update          # Refresh the local package index
sudo apt upgrade         # Install available updates
sudo apt install [pkg]   # Install a new tool
sudo apt autoremove      # Clean up unnecessary dependencies

Networking & Remote Access


Essential for managing servers or local environments.

  • ip a: Shows all IP addresses and network interfaces.

  • ping -c 4 google.com: Checks connectivity with a limited count (so it doesn't run forever).

  • ssh user@ip-address: Securely connect to a remote machine.

  • scp [file] user@remote:/path: Securely copy files between hosts.

  • netstat -tulpn: Shows all active ports and the services listening on them.

Developer & DevOps Modules


For users running containers, local AI, or heavy-duty deployments.

  • docker ps: Lists running containers.

  • docker-compose up -d: Starts a multi-container environment in the background.

  • rsync -avz: The gold standard for syncing files between directories or servers (compressed and fast).

  • systemctl status [service]: Checks if a service (like PostgreSQL or Nginx) is running.

  • journalctl -u [service] -f: Views live logs for a specific system service.

Database Management (PostgreSQL)


Since most modern ERPs and web frameworks rely on PostgreSQL, these commands ensure data integrity and facilitate quick migrations.

Core Database Operations
  • sudo -u postgres psql: Enters the PostgreSQL interactive terminal as the superuser.

  • \l: (Inside psql) Lists all available databases.

  • \c [database_name]: (Inside psql) Connects to a specific database.

  • DROP DATABASE [name];: Permanently removes a database (use with extreme caution).

Backup & Recovery
  • pg_dump -U [user] [db_name] > backup.sql: Exports a database to a single script file.

  • psql -U [user] [db_name] < backup.sql: Restores a database from a .sql file.

  • pg_restore -d [db_name] [file.dump]: Used for restoring "Custom" or "Tar" format backups which are often smaller and faster than plain SQL.

The Networking Stack


Networking in Ubuntu has evolved from ifconfig to the modern ip suite. Use these to diagnose connectivity, DNS, and port availability.

CommandActionReal-World Use Case
ip aList IP AddressesFind your local IP to access your server via browser.
ss -tulpnSocket StatisticsCheck if Odoo (8069) or PostgreSQL (5432) is listening.
curl -I [URL]Fetch Header OnlyVerify if a web service is up without downloading the page.
dig [domain]DNS LookupCheck if your domain is pointing to the correct IP address.
mtr [domain]Network PathA "live" traceroute to see exactly where a connection is dropping.
nmcli dev wifiWiFi ManagementList and connect to wireless networks via terminal.

Troubleshooting Linux


These commands help you move from "it's broken" to "here is the fix."

1. General System Issues
  • dmesg -T | tail -20: Shows the latest kernel-level messages (useful for hardware or driver failures).

  • journalctl -p 3 -xb: Shows only Errors (priority 3) since the last boot.

  • kill -9 [PID]: Forces a "hung" process to terminate immediately when it won't close normally.

  • lsof -i :8069: "List Open Files"—tells you exactly which process is "squatting" on a specific port.

2. Service-Specific Troubleshooting
SymptomCommand to Diagnose
Service won't startsystemctl status [service] — Look for the "Active: failed" line.
Disk is fulldu -sh /* 2>/dev/null — Finds which top-level folder is eating space.
High CPU usagehtop (Sort by %CPU) — Identifies the specific thread causing the lag.
Permissions errornamei -l /path/to/file — Breaks down the permissions of every folder in the path.

Local AI & LLM Management


For users running local models and RAG (Retrieval-Augmented Generation) frameworks, these commands manage the lifecycle of Large Language Models and system resources.

  • ollama run [model_name]: Downloads (if necessary) and starts an interactive session with a model (e.g., Llama3 or Mistral).

  • ollama list: Displays all locally stored models and their sizes.

  • ollama rm [model_name]: Frees up disk space by removing unused models.

  • nvidia-smi: (For NVIDIA users) Monitors GPU VRAM usage—critical when running high-parameter models.

  • top -p $(pgrep ollama): Monitors the specific CPU and memory impact of the AI engine.

  • curl http://localhost:11434/api/tags: A quick way to verify if your local AI API is active and responding to external requests.

Odoo & ERP Administration


This section covers the essential commands for managing enterprise-level ERP deployments, focusing on service stability and debugging custom modules.

CommandActionPurpose
sudo systemctl restart odooRestart ServiceApplies configuration changes in odoo.conf.
tail -f /var/log/odoo/odoo-server.logLive Log FeedThe primary tool for debugging "Internal Server Errors."
./odoo-bin -u all -d [db_name]Force UpdateUpdates all modules for a specific database.
./odoo-bin -i [module_name]Fresh InstallInstalls a specific module from the terminal.
pggrep -af odooProcess CheckIdentifies all running Odoo instances and their PIDs.

Pro Tip: Use the -c flag with odoo-bin to specify a custom configuration file path when running multiple versions or instances on the same server.

ERP & Database Troubleshooting
  • "Connection Refused" (Database): Check if the service is running with systemctl status postgresql and verify pg_hba.conf allows the connection.

  • "Internal Server Error" (ERP): Look for Python Traceback in the logs using tail -n 100 /var/log/[service].log.

  • "Out of Memory" (Local AI): Use free -h and nvidia-smi. If Swap is being used heavily, the model will run extremely slowly.

Linux commands list on github, follow us!

View on github