I am trying to delete all files that are older than 7 days. The command is working but not correctly. It does delete files but it’s not accurate. The find does delete files, but when I run the ls command does contain files that should be deleted. For example today is November 7th. The find should delete…
Tag: linux
Replace characters on specific location every line
We got an exercise where we have to do certain things with the following text document: It’s all data seperated by a “|”. For this exercise, if the year of the first ascent is empty, I need to replace the “||” with “|unclimbed|” I can’t do it like this: Because …
sed command to replace all last lines with some new multi line strings after getting second pattern
I want to write a program to change systems ip address from dhcp/static to static only. my original file’s contents will be either this or it may be like this, Now, i want to change after [ipv4] pattern, so that after editing my file should looks like this Answer Here’s a Perl solution. It sets th…
How to tell which version of OpenGL my graphics card supports on Linux
I am trying to figure out which version of OpenGL my graphics card and driver currently support. This answer suggests running glxinfo | grep OpenGL which if fine, but here is (some) of that output: So it is hard to tell, is it 4.5 or 4.6? Also the official documentation from nVidia does not mention the answer…
Kubernetes on 32 bit machine
While I was running kubectl command in my ubuntu 16.04 os which is a 32 bit machine, I was getting cannot execute binary file: Exec format error Can some one tell me whether Kubernetes works on 32 bit machine or not ? Answer Currently there are no ready-made binaries for 32bit systems at: https://github.com/k…
How to debug USB HID scancode-keycode translation in Linux
I have recently converted a 122-key terminal keyboard to USB as a configfs USB gadget (the keyboard portion is using HID codes), it works quite well in except that I cannot seem to get my Archlinux installation to recognize certain HID codes (specifically at the moment F13-F24) and translate them into event c…
How to get the status of parallel port printer under Linux?
How to get the status of parallel port printer under Linux, such as paper missing, the device is not installed. Or How to get through the CUPS printer status etc. Answer } }
Units of tx_queue & rx_queue in /proc/net/tcp
On a Linux 2.6.32, i’m looking at /proc/net/tcp and wondering what is the unit of tx_queue and rx_queue. I can’t find this information about receive-queue and transmit-queue in https://www.kernel.org/doc/Documentation/networking/proc_net_tcp.txt Nor in man 5 proc which shows only: The “tx_qu…
check password linux user
I am on debian 9. I have a problem to check the password of a linux user in my scripts. I realized that the different linux tools for creating and modifying a user password gave results of different pattern in /etc/shadow To create a user I have in /etc/shadow In another script I want check the password input…
how to print lines with specific column matching members of array in bash
How to print lines when the first column matching members of array(“12” or “34” or “56”)? Add Also, how to print lines when the first column exactly matching members of array(“12” or “34” or “56”)? Answer You could use bash to interpolate…