Skip to content

Tag: linux

OS for Docker Image – Flavors

I’m very curious if most people are simply using Ubuntu for the majority of Linux flavors out there for their Docker images or if they’re using others. Can you tell me if you are using Ubuntu and if not why..and what else are you using? Is Ubuntu the defacto flavor just in general? Answer Many peo…

Reading tabular data from a line in bash [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 7 years ago. Improve this question I need to check if the pin that user gives exists and if exists then display their names and…

Running a shell script for a certain duration

I want to be able to run a script on Linux shell (bash) for a certain duration and sleep for a different duration. I’ve written something like the following snippet. However, I see only the sleep happening correctly but the execution stops after first execution. The response I get is ./script.sh: line 3…

Root autentication on a Python program

I have the root password saved in a variable. How I can give the root authorization at my program? This can be an example: Answer It is impossible to do it in the way you try. Your program is already started under some non-root user and you cannot change it inside this program. You can spawn other process whi…

SED : Remove last four characters from filename

I had list of files in the folder named test_images as below i want to rename all file by removing last four characters from each of them as How can i do it using sed ? Any suggestion will be appreciated. Thanks in advance 🙂 Answer if your file names don’t have spaces, you can: (under your test_images d…

Linux Command to list all users by uid

I am using RedHat Linux 6. I need redhat Linux terminal code to list all the users above uid=499? i already tried “cat /etc/passwd”. but it shows all users. how do i filter it? Answer You can use awk to parse the passwd database for the UIDs you want. To list all the users for UIDs strictly greate…