I have to delete specific files on an ubuntu server.

(If users have an problem with changing to home office and back)

I use to run

sudo find <start> -type f -name geometry.<bs>.<login>.pas -exec rm {} ';'
  • start is the base directory of the "application system" somwhere in the linux filesystem and mounted as drive "A:" in a windows batch-file.
  • bs is either "linux" or "win" (or "*" of course)
  • login is the users login name (e.g. jpublic)

The program itself runs from a special path where are linux- and windows-executables (e.g. "cockpit" for linux and "cockpit.exe" for windows.

To start the program from windows, there is a batch-file. There the Program ist startet by

start A:\...\cockpit.exe

So I would like to have a windows executable to delete the "geometry" files. Is it possible in any kind to run a bash script from windows?

  • Sure you could run Bash on Windows. However, I suggest using Batch or PowerShell instead. // But in the first place, are users even authorized to delete files on the share?
    – Daniel B
    Nov 1, 2022 at 10:03
  • @DanielB - I think of a possibility that users can delete their own "geometry" files. Nothing else of course. So maybe its possible to trigger a bash script running on the server.
    – Andy A.
    Nov 1, 2022 at 10:13
  • I would suggest using Windows Subsystem for Linux (v1 and not V2). You might need to tweak a few paths but it will work. You can run windows exe files and linux files from the same bash prompt seamlessly. Why not WSL2? Because it isn't as closely linked as v1. Cygwin will probably also work but isn't nearly as good of a solution. The internet will tell you how to install WSL1 vs WSL2. Nov 1, 2022 at 14:28


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.