• Home
  • Guides
    • All
    • Linux
    • Programming
    • Tools
    • WordPress
    Server-Side Image Conversion with Apache

    Server-Side Image Conversion with Apache

    Imposter Syndrome as a Self-Taught Developer

    Imposter Syndrome as a Self-Taught Developer

    Fastest Way to Extract a Massive .tar.gz File on Linux

    Fastest Way to Extract a Massive .tar.gz File on Linux

    Monitor SSL Expiration with Python

    Monitor SSL Expiration with Python

    Building a Simple WordPress Post List Tool with PHP

    Building a Simple WordPress Post List Tool with PHP

    Monitoring Web Page Changes with Python

    Monitoring Web Page Changes with Python

    My SSH Setup: How I Manage Multiple Servers

    My SSH Setup: How I Manage Multiple Servers

    Building a Network Tracker Auditor for Privacy with Python

    Building a Network Tracker Auditor for Privacy with Python

    Streaming Audio Files Securely with PHP

    Streaming Audio Files Securely with PHP

  • Blog
    • All
    • Artificial Intelligence
    • Privacy
    • Reviews
    • Security
    • Tutorials
    Why Stable Websites Outperform Flashy Redesigns

    Why Stable Websites Outperform Flashy Redesigns

    AdGuard Ad Blocker Review

    AdGuard Ad Blocker Review

    Surfshark VPN Review

    Surfshark VPN Review

    Nmap Unleash the Power of Cybersecurity Scanning

    Nmap: Unleash the Power of Cybersecurity Scanning

    Floorp Browser Review

    Floorp Browser Review

    Understanding Man-in-the-Middle Attacks

    Understanding Man-in-the-Middle Attacks

    Privacy-Focused Analytics

    Privacy-Focused Analytics: Balancing Insights and Integrity

    Safeguarding Your Facebook Account

    Safeguarding Your Facebook Account: Understanding the Differences Between Hacking and Cloning

    38 essential points to harden WordPress

    38 Essential Points to Harden WordPress

  • Apps
    • Bible App
    • Bible Verse Screensaver
    • Blue AI Chatbot
    • Early Spring Predictor
    • FIGlet Generator
    • Password Generator
    • StegX
    • The Matrix
    • WeatherX
    • Website Risk Level Tool
  • About
    • About JMooreWV
    • Live Cyber Attack Stats
  • Contact
    • General Contact
    • Website Administration & Cybersecurity
No Result
View All Result
  • Home
  • Guides
    • All
    • Linux
    • Programming
    • Tools
    • WordPress
    Server-Side Image Conversion with Apache

    Server-Side Image Conversion with Apache

    Imposter Syndrome as a Self-Taught Developer

    Imposter Syndrome as a Self-Taught Developer

    Fastest Way to Extract a Massive .tar.gz File on Linux

    Fastest Way to Extract a Massive .tar.gz File on Linux

    Monitor SSL Expiration with Python

    Monitor SSL Expiration with Python

    Building a Simple WordPress Post List Tool with PHP

    Building a Simple WordPress Post List Tool with PHP

    Monitoring Web Page Changes with Python

    Monitoring Web Page Changes with Python

    My SSH Setup: How I Manage Multiple Servers

    My SSH Setup: How I Manage Multiple Servers

    Building a Network Tracker Auditor for Privacy with Python

    Building a Network Tracker Auditor for Privacy with Python

    Streaming Audio Files Securely with PHP

    Streaming Audio Files Securely with PHP

  • Blog
    • All
    • Artificial Intelligence
    • Privacy
    • Reviews
    • Security
    • Tutorials
    Why Stable Websites Outperform Flashy Redesigns

    Why Stable Websites Outperform Flashy Redesigns

    AdGuard Ad Blocker Review

    AdGuard Ad Blocker Review

    Surfshark VPN Review

    Surfshark VPN Review

    Nmap Unleash the Power of Cybersecurity Scanning

    Nmap: Unleash the Power of Cybersecurity Scanning

    Floorp Browser Review

    Floorp Browser Review

    Understanding Man-in-the-Middle Attacks

    Understanding Man-in-the-Middle Attacks

    Privacy-Focused Analytics

    Privacy-Focused Analytics: Balancing Insights and Integrity

    Safeguarding Your Facebook Account

    Safeguarding Your Facebook Account: Understanding the Differences Between Hacking and Cloning

    38 essential points to harden WordPress

    38 Essential Points to Harden WordPress

  • Apps
    • Bible App
    • Bible Verse Screensaver
    • Blue AI Chatbot
    • Early Spring Predictor
    • FIGlet Generator
    • Password Generator
    • StegX
    • The Matrix
    • WeatherX
    • Website Risk Level Tool
  • About
    • About JMooreWV
    • Live Cyber Attack Stats
  • Contact
    • General Contact
    • Website Administration & Cybersecurity
No Result
View All Result
Home Guides Programming Python

Bulk Convert Windows URL Shortcuts to Linux Link Shortcuts

Jonathan Moore by Jonathan Moore
6 years ago
Reading Time: 2 mins read
A A
Bulk Convert Windows URL Shortcuts to Linux Link Shortcuts
FacebookTwitter

Are you migrating from the Windows Operating System to a Linux distribution and have shortcuts to your favorite websites stored on your Windows system?

Both Windows and Linux utilize a different file format for shortcuts. You cannot copy your Windows shortcuts to a Linux desktop and expect that they will work, because they won’t. You will need to convert them into a format that Linux understands.

Windows URL shortcuts are stored in text files that end with either “.url” or “.website”, whereas Linux shortcuts are stored in text files that simply end with “.desktop”. The only common property within both of the Windows and Linux shortcuts is the URL property.

Luckily, Python can handle this conversion for us. The Python script below will iterate through a given directory and convert all of your Windows shortcuts into Linux-compatible shortcuts.

#!/usr/bin/python3

import os


def convert(directory):
    # Add all files from the directory into a list
    files = os.listdir(directory)
    # Iterate through the directory list
    for file in files:
        # Look for files ending in ".url" or ".website"
        if file.endswith(('.url', '.website')):
            # Set a file name without the file extension
            filename = os.path.splitext(file)[0]
            # Create new filename for Linux shortcut
            new_filename = os.path.join(directory, filename+".desktop")
            # Open and Read the file into memory
            with open(os.path.join(directory, file), "r") as f:
                # Loop through each line of the file
                for line in f:
                    # Strip line breaks from the end of each line
                    line = line.rstrip()
                    # Find the line that starts with "url="
                    if "url=" in line.lower():
                        # Create new Linux shortcut
                        with open(new_filename, "w") as nf:
                            nf.write("[Desktop Entry]\n")
                            nf.write("Name=" + filename + "\n")
                            nf.write("Type=Link\n")
                            nf.write("Icon=text-html\n")
                            nf.write(line)


if __name__ == "__main__":
    # Pass the Directory to the convert function
    convert("/home/user/Desktop/Windows Shortcuts")

 

Tags: ProgrammingPython
ShareTweetSharePinShareShareScan
ADVERTISEMENT
Jonathan Moore

Jonathan Moore

I am a Software Architect and Senior Software Engineer with 30+ years of experience building applications for Linux and Windows systems. I focus on system architecture, custom web platforms, server infrastructure, and security-focused tools, with an emphasis on performance and reliability. Over the years, I have built everything from WordPress plugins and automation systems to full platforms, ad serving systems, monitoring tools, and API-driven applications. I prefer working close to the system, solving real problems, and building tools that are meant to be used.

Related Articles

Server-Side Image Conversion with Apache

Server-Side Image Conversion with Apache

I stopped relying on third party image services a while ago. They work, but they add cost, latency, and another...

Fastest Way to Extract a Massive .tar.gz File on Linux

Fastest Way to Extract a Massive .tar.gz File on Linux

When I am dealing with a 40GB or 50GB website backup, I do not just run tar -xzf file.tar.gz and...

Monitor SSL Expiration with Python

Monitor SSL Expiration with Python

SSL certificates are one of those systems that work quietly in the background until something goes wrong. When a certificate...

Next Post
The Ultimate Spy Game

The Ultimate Spy Game

Recommended Services

Latest Articles

Server-Side Image Conversion with Apache

Server-Side Image Conversion with Apache

I stopped relying on third party image services a while ago. They work, but they add cost, latency, and another...

Read moreDetails

Imposter Syndrome as a Self-Taught Developer

Imposter Syndrome as a Self-Taught Developer

I started writing code over 35 years ago. Everything I learned came from figuring things out on my own, long...

Read moreDetails

Fastest Way to Extract a Massive .tar.gz File on Linux

Fastest Way to Extract a Massive .tar.gz File on Linux

When I am dealing with a 40GB or 50GB website backup, I do not just run tar -xzf file.tar.gz and...

Read moreDetails

Monitor SSL Expiration with Python

Monitor SSL Expiration with Python

SSL certificates are one of those systems that work quietly in the background until something goes wrong. When a certificate...

Read moreDetails
  • Privacy Policy
  • Terms of Service

© 2025 JMooreWV. All rights reserved.

No Result
View All Result
  • Home
  • Guides
    • Linux
    • Programming
      • JavaScript
      • PHP
      • Python
    • Tools
    • WordPress
  • Blog
    • Artificial Intelligence
    • Tutorials
    • Privacy
    • Security
  • Apps
    • Bible App
    • Bible Verse Screensaver
    • Blue AI Chatbot
    • Early Spring Predictor
    • FIGlet Generator
    • Password Generator
    • StegX
    • The Matrix
    • WeatherX
    • Website Risk Level Tool
  • About
    • About JMooreWV
    • Live Cyber Attack Stats
  • Contact
    • General Contact
    • Website Administration & Cybersecurity