Facebook Pixel Bringing Linux Power to Windows by Building Custom Commands | Open Source For You - technology - Lees dit verhaal op Magzter.com
Ga onbeperkt met Magzter GOLD

Ga onbeperkt met Magzter GOLD

Krijg onbeperkte toegang tot meer dan 9000 tijdschriften, kranten en Premium-verhalen voor slechts

$149.99
 
$74.99/Jaar

Poging GOUD - Vrij

Bringing Linux Power to Windows by Building Custom Commands

Open Source For You

|

January 2026

This brief tutorial will help you build Python versions of two vital Linux commands-ls and grep.

Bringing Linux Power to Windows by Building Custom Commands

As developers, we often find ourselves switching between Linux and Windows environments. While Windows has made strides with PowerShell and WSL (Windows Subsystem for Linux), sometimes you just want the familiar UNIX-like commands available natively. That is why I created Python-based implementations of two essential Linux commands—ls and grep—and deployed them as native Windows executables.

Why recreate these commands?

Windows has dir instead of ls and findstr instead of grep, but their syntax and behaviour differ significantly from their UNIX counterparts. For developers who work across platforms, having consistent commands can significantly improve workflow efficiency. By creating Python versions and converting them to executables with PyInstaller, we get:

  • Cross-platform consistency: Same syntax across Windows and Linux.

  • Easy customisation: Python code is simple to modify.

  • Native performance: Compiled executables run directly without Python interpreter overhead.

  • System-wide availability: Placed in System32 for global access.

The ls command: Windows directory listing, UNIX style

The ls command lists directory contents with UNIX like formatting and options. Let’s break down the key components.

The core functions are:

get_file_attributes(filepath) def get_file_attributes(filepath): """Get Windows file attributes"""

This function retrieves Windows-specific file attributes (Hidden, System, ReadOnly, Archive) using the stat module. It returns a compact string representation like 'HSR' for a hidden, system, read-only file.

format_permissions(mode) python def format_permissions(mode): """Format file permissions for Windows"""

MEER VERHALEN VAN Open Source For You

Open Source For You

Open Source For You

Apple acquires open source photonics startup invrs.io and hires its founder

Open source technology sits at the heart of Apple's latest acquisition.

time to read

1 min

April 2026

Open Source For You

OpenClaw adoption wave lifts China's tech stocks

OpenClaw, an open source autonomous AI agent, is driving a wave of investor enthusiasm in mainland China's stock markets, lifting shares of companies linked to the technology even as broader market sentiment remains subdued.

time to read

1 min

April 2026

Open Source For You

Open Source For You

NVIDIA's NemoClaw could power Al-based warfare for India

NVIDIA has introduced NemoClaw, an open source, chip-agnostic AI platform designed to deploy agentic AI systems.

time to read

1 min

April 2026

Open Source For You

Open Source For You

Microsoft flags fake Next.js repos are embedding staged backdoors inside build scripts

Attackers are seeding the open source ecosystem with malicious yet legitimatelooking Next.js repositories that embed staged backdoors inside build scripts and Microsoft dependencies, according to Microsoft.

time to read

1 min

April 2026

Open Source For You

Open Source For You

NeoNephos expands its open source cloud ecosystem with new members

NeoNephos Foundation has expanded its pan-European open source cloud coalition with the addition of BWI GmbH as a Premier Member, SUSE LLC as a General Member, and Fraunhofer ISST as an Associate Member.

time to read

1 mins

April 2026

Open Source For You

Open Source For You

Meta's Manus AI allows users to operate its agents through Telegram

The rise of OpenClaw is reshaping the AI agent market, compelling closed platforms to mirror features first popularised in the open source community. The latest example: Manus AI has introduced Telegrambased mobile control, a capability long central to OpenClaw's messaging-first approach.

time to read

1 min

April 2026

Open Source For You

Open Source For You

China's DeepSeek has more than 75 million downloads on Hugging Face

Chinese AI lab DeepSeek is turning open source momentum into hardware leverage, with more than 75 million downloads of its models on Hugging Face helping Chinese AI releases surpass every other country on the platform.

time to read

1 min

April 2026

Open Source For You

Open Source For You

Fractal's LLM Studio will help build domain-specific AI models

Fractal Analytics has launched LLM Studio, an enterprise platform designed to build, evaluate, and operate domain-specific language models using open source foundations, marking a shift away from closed, API-led AI approaches.

time to read

1 min

April 2026

Open Source For You

Open Source For You

Monitoring Machine Learning in Production

Discover the concepts of drift and data skew, and explore online monitoring techniques that keep your machine learning model relevant.

time to read

5 mins

April 2026

Open Source For You

Open Source For You

Managing Multi-Cloud Infrastructure: The Way Forward

Kubernetes and open source control planes make multi-cloud operations easier and help organisations build scalable and cloudagnostic infrastructure platforms.

time to read

7 mins

April 2026

Listen

Translate

Share

-
+

Change font size