How to extract a single word from an os.system command?

Advertisements I’m writing a python program where I do some os.system(cmd). I would need to extract one single word from the terminal output. The output contains a seire of informations. Inside this information, I only need the parameter address, as a simple string. How could I do? This is an example of the ouput: ——————————–… Read More How to extract a single word from an os.system command?

Command-Line Arguments Problem in C-language in Kali Linux?

Advertisements I am trying to develop a program that will display contents of a file and copies content of file1.txt to file2.txt in kali linux using command-line arguments. Here is the code: #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char *argv[]){` char show[6] = "–show"; char copy[6] = "–copy"; char help[2] ="-h"; if(argc… Read More Command-Line Arguments Problem in C-language in Kali Linux?

I want to display users of my linux whose name ends with a number

Advertisements I want to display users in my linux whose name ends on number I tried grep ‘[0-9]’ /etc/passwd but it displays all lines containing numbers >Solution : You can use awk for this: awk -F: ‘{ print $1}’ /etc/passwd | grep ‘[0-9]$’ Alternatively you could also use cut cut -d: -f1 /etc/passwd | grep… Read More I want to display users of my linux whose name ends with a number

change scientific notation to number in Linux

Advertisements I have a file .txt like belowe AXN1 6.9e+07 69000000 AXN2 7.2e+07 72000000 AXN2 81000000 81000000 AXN3 1.18e+08 118000000 AXN4 7.7e+07 77000000 AXN9 8e+07 80000000 AXN11 800000 800000 AXN11 2.9e+07 29000000 AXN12 48000001 48000001 AXN18 4.8e+07 48000000 I want get that AXN1 69000000 69000000 AXN2 72000000 72000000 AXN2 81000000 81000000 AXN3 118000000 118000000 AXN4… Read More change scientific notation to number in Linux