How would I apply a logic to all files in a directory and pipe the final output of each input file to a separate file? Something like below (actual command is long, but I used above for simplicity to better understand the logic to all the files in a directory) Answer You can use a for-loop over the filenames:…
Tag: linux
What is the time complexity of ‘ls’ command when run on ext4 filesystem?
I have a couple hundred thousand files in one of the directory on a Redhat Linux server. I need to execute ls -t to fetch the name of the last edited file and upload the filename to a database. Lately I have started facing problems as the number of files in the directory keeps growing and want to know the
how to read csv files with mbcs codec in Python on Linux?
I’m trying to read CSV files with Western Europe (windows) encoding This code works well on Windows but not on Linux 18.04. (Error: unknown encoding: mbcs) Indeed, in the codecs python documentation, we have the information: is there another way/name to decode my files in python on Linux? (I have thousa…
Install4j Zipped .sh for Linux
I am generating a Unix/Linux GUI installer with install4j. The problem is that when users try to download the .sh, the browser opens the script’s text instead of prompting to download. (I know this doesn’t depend on install4j and is the browser’s behavior). I also know that the are Linux arc…
Unix -Delete even bytes from a file
I want to find and delete all even bytes from a file given in command line. Is there any command for this situation? Answer I think this does what you want. It dumps the file as continuous plain hex, then reads two bytes, saving them for later and then two more bytes. Then it outputs the bytes it saved and
Declaring variables with indirect reference with a prefix
I have my parameters stored in a file and calling them with a prefix which i get it has input. now, i am getting the input and prefixing it and storing as a new variable and then pointing my new variable indirectly to my actual variable to use in my script. Is there a way to directly mention the indirect
“Authentication failed” in Wayland application
First of all, sorry for a potentially silly question, it’s my first attempt to work with Wayland. But i’ve googled and could not find anything related. The system which i develop, is very time-critical in running graphicall applications, so i’ve managed to run Weston and the desired applicat…
Is it possible to build an OpenCV app on Linux and execute it on Windows?
I am new on Linux, OpenCV and deep learning, in fact I just started with these things a couple weeks ago. In my reserches I found a lot of people saying that is much better use OpenCV on Linux than on Windows, so, that is what I am doing. I installed an Ubuntu distro on a VM and I am
Why does `^M` appear in terminal output when looking at some files?
I’m trying to send file using curl to an endpoint and save the file to the machine. Sending curl from Linux and saving it on the machine works well, but doing the same curl from Windows is adding ^M character to every end of line. I’m printing the file before saving it and can’t see ^M. Only…
CMAKE_PREFIX_PATH for Qt5
I want to compile this which requires Qt 5.14 and I have Qt 5.12 installed from my linux repository.I just compiled Qt from source and installed it in /usr/local/Qt-6.0.0/(default location). But CMake prints the following error although I’ve added set(CMAKE_PREFIX_PATH “/usr/local/Qt-6.0.0/include…