command-line

How (abc) is parsed in bash

How (abc) is parsed in bash I’m using a program designed for windows that I compiled myself for GNU/linux. The program works in the command line, and one argument looks like this: prgm -arg1 abcd(10)(22) -i files.ext Where (10) and (22) are flags like a, b, c and d. This command is failing because bash …

Total answers: 2

How to find a string in files, said string including line breaks, ", @

How to find a string in files, said string including line breaks, ", @ I know grep allows me to search for a string in files, however I did not manage to find the right method to search for the following string: "snapshot3" : { "@custom_name" : true So the string I am looking for …

Total answers: 1

How can I write my input down to file?

How can I write my input down to file? Recently, I needed to write my terminal output down. And I’ve read this question to find the answer. But now, I would like to write my commands down (which I type in terminal, for example:sudo apt update etc.) to store the history of what I have …

Total answers: 1

Why is the manual of apt incomplete?

Why is the manual of apt incomplete? I would like to see what are the command-line switches of apt list but after 30min of research I don’t manage to find a lot of information about it… I tried to type apt list –help, man apt and man apt-get but didn’t get much information especially about …

Total answers: 1

When is useful use "silent" for tty?

When is useful use "silent" for tty? If the tty –help command is executed it shows tty –help Usage: tty [OPTION]… Print the file name of the terminal connected to standard input. -s, –silent, –quiet print nothing, only return an exit status –help display this help and exit –version output version information and exit Therefore …

Total answers: 1

Loop through file extension Annotate add EXIF Rename and Copy

Loop through file extension Annotate add EXIF Rename and Copy This script, reads user input from an entry like filename.jpg it creates a directory inside the current directory. Then renames the file and adds the files EXIF data it then copies the original file to the directory that was just created. Using convert from imagemagick …

Total answers: 1

How can I upgrade the "find" command to the latest version?

How can I upgrade the "find" command to the latest version? I got this answer for Is it possible to chain two consecutive find commands? last year. Today I wanted to test the latest recommendation to pipe two find commands together. find … -print0 | find -files0-from – … To my surprise it did not …

Total answers: 1

Rename and add a number to all folders in a directory

Rename and add a number to all folders in a directory I have a simulation folder on hpc which contains time directories from 0 to 50 with a step of 0.1 (so 501 folders in total with their names as 0, 0.1, 0.2.. and so forth). Example output of ls: 0 0.1 0.2 0.3 0.4 …

Total answers: 1

mv command: moving only certain extension files, not having a string in their name

mv command: moving only certain extension files, not having a string in their name I am trying to incorporate ‘mv’ command in a dockerfile. I want to move only those files having certain extension, but not having a string in their name. Suppose src directory has abc.txt, abcu.txt, def.xml, 1abc2.txt, mno.txt, pqr.txt and I want …

Total answers: 1

Where can I add to the ***universal*** path?

Where can I add to the ***universal*** path? I’m a script kiddie of sorts and enjoy writing bash scripts for things, and I keep them in a repository that I synchronize, and on my personal computers I keep it in a home/otherStuff/customBin folder, but… while I can add it to the .bashrc of every profile …

Total answers: 2

Terminal always shows these extra lines after being opened

Terminal always shows these extra lines after being opened I am using Kubuntu 22.04.3. Whenever I open the terminal (or konsole), the following five lines are always displayed. bash: enable: bash: not a shell builtin bash: enable: completion: not a shell builtin bash: enable: in: not a shell builtin bash: enable: interactive: not a shell …

Total answers: 1

Bash script – new Konsole closing

Bash script – new Konsole closing I’m working on a project that requires me to open some new bash windows to start the docker, server, etc. of the project. I’m trying to make a script so I can start things faster. So far I have this: #!/bin/bash cd dev/proj/prod/; konsole –hold –new-tab -e echo "Hello …

Total answers: 1

Bash script with different CWD from parent shell?

Bash script with different CWD from parent shell? I’m doing a puzzle for my computer science class where I need to execute the binary /challenge/executable via a shell script, from the CWD of /tmp/exampledir, with the shell’s CWD being a different directory from the shell script’s, or as the challenge phrases it: the challenge checks …

Total answers: 1

how to copy files with some pattern from multiple directories to a single directory?

how to copy files with some pattern from multiple directories to a single directory? I have a directory structure base |_folder_34231 | |_23491_this_I_want.csv | |_23491_this_I_dont_want.csv | |_some_other_things_I_dont_need | |_some_other_folder_I_dont_need | |_folder_30941 | |_30912_this_I_want.csv | |_30912_this_I_dont_want.csv | |_some_other_things_I_dont_need | |_some_other_folder_I_dont_need | |_folder_55587 | |_17777_this_I_want.csv | |_17777_this_I_dont_want.csv | |_some_other_things_I_dont_need | |_some_other_folder_I_dont_need | |_folder_60920 | |_83821_this_I_want.csv | |_83821_this_I_dont_want.csv …

Total answers: 1

Why pipe keep sudo and redirection not?

Why pipe keep sudo and redirection not? Pipe (|) and redirections (<, <<, >, >>) both using standard streams (stdin, stdout, stderr), but although only pipe can keep sudo privileges, why? Works: sudo echo "hello" | tee /root/test Doesn’t work: sudo echo "hello" > /root/test Asked By: linuxer || Source Pipe (|) and redirections (<, …

Total answers: 2

How to make the current working directory be highlighted in color?

How to make the current working directory be highlighted in color? my ns-3 is installed inside the source folder i.e., home/my_username/source/ns-3.39, when I try to ls inside the ns-3.39 directory, it gives: ls: cannot open directory ‘.’: Permission denied So I have to su root and then enter the ns-3.39 directory to use it. The …

Total answers: 1

Multiply found text in sed – is it possible?

Multiply found text in sed – is it possible? This is what I have: echo -e "at4nbt7nct2ndt12n" | sed -rn ‘s/(.*)t([0-9]*)$/2t111t/p’ 4 aaa 7 bbb 2 ccc 12 ddd This I want: 4 aaaa 7 bbbbbbb 2 cc 12 dddddddddddd Is this possible in sed only or I have to use some other tools? Asked …

Total answers: 1

How to access the manpage fo a flatpak application?

How to access the manpage fo a flatpak application? Where does one find the manpage of a flatpak application? For example, I know that Thunderbird usually has a manpage. However, I have tried the following two commands to no avail. [user ~]$ man thunderbird No manual entry for thunderbird [user ~]$ flatpak run –command="bash" org.mozilla.Thunderbird …

Total answers: 1