93,020 questions
Advice
0
votes
1
replies
20
views
Couldn't create 'foo' directory with mkdir after 'git clone' failed
First, I ran the command git clone <url> 'foo', but the process was terminated because the drive was full.
Then, I tried mkdir foo. Although the command exited with status 0 (no outout), the ...
Advice
0
votes
2
replies
53
views
Get cmd file for copying Files
i need to make cmd file that copying "Merge.txt" from the same path directory of cmd file to "D:\StackFlow\"
Note: i want to copy that file whenever i changed the directory source
3
votes
1
answer
114
views
Java shell pipeline: `head` command doesn't output lines until it receives the expected number, even with `tail -f`
I'm building a shell in Java and currently implementing pipeline logic. For inter-process communication, I've created this class:
public class PipeConnector implements Runnable {
private final ...
0
votes
1
answer
34
views
Ensure my scripts stops the service before the system does [closed]
I am trying to implement a shutdown hook on my Debian machine, in which I want to stop a service before the system does (besides other steps).
This is my pre-shutdown.service placed under /etc/systemd/...
2
votes
1
answer
77
views
Is there a functional difference between piping a variable with printf vs using parameter expansion in a heredoc?
Is there a functional difference when piping a shell variable with printf or using a heredoc and expanding the variable inside the heredoc?
Piping:
txt=…
printf '%s\n' "$txt" | xxd
Heredoc:
...
1
vote
1
answer
47
views
GIT command is not returning any value in makefile
I have a simple makefile that should print the Git log, which looks as below.
SHELL=/bin/bash
get_log:
echo $(git log)
3
votes
3
answers
166
views
Reading desktop notifications from the command line. Debian/Ubuntu
Running Ubuntu 24.04lts.
NOTE: I am trying to read the notification sent by he Discord app to my personal desktop notifications. When I notification from a specific sender, with a specific message, I ...
Advice
0
votes
1
replies
43
views
Analyze a directory in a performant (cross-platform) way for what file types (file extensions) it (recursively) contains?
Aim
My aim is to analyze a (big) (sub)directory and just find out what file extensions all files have there (recursively).
Additionally, these conditions apply:
I am on Windows, but I could use WSL ...
Best practices
3
votes
2
replies
103
views
How to efficiently bulk download from the internet archive
I want do download certain search results from the internet archive. I would like that the names of the resulted files and directories to be the title of the work -- idealy YYYY_<author>_<...
1
vote
1
answer
182
views
How to do nothing with "for in" in Bash? [closed]
for in in Bash is setting variable. I need only the variable itself from this command.
for VAR in FILE*; do
something (hate it)
done
I plan to use this variable later, not in the block itself. Just ...
1
vote
1
answer
81
views
Disable touchpad script fails while copied output works
I downloaded Fedora 43 Cosmic (Wayland) and found no way to disable my touchpad (mouse is always connected). xinput and synclient seem to be X11 only. Touchpad Disable is a simple checkbox with KDE ...
Tooling
0
votes
7
replies
136
views
One liner to get distinct values of all columns of a tsv
I am looking for a one liner that could be run in a linux terminal that does the below.
Takes as input a tab separated file (tsv) with many columns (~100) and creates a two column tsv output with ...
2
votes
4
answers
142
views
Is it the tty, the shell, or both that is responsible for echo-ing user input?
I seem to be observing conflicting evidence regarding how the tty and the shell share responsibility for displaying user input.
In the following interactive session, user input is no longer echoed to ...
1
vote
1
answer
85
views
How do I feed standard input to an Expect script to spawns a shell and collect standard output?
Consider the following Expect and Bash scripts:
spawn-bash.exp
#!/usr/bin/env expect
spawn bash
stty raw -echo
log_user 0
remove_nulls 0
expect {
-i $spawn_id "?" {
send_user -- [...
3
votes
1
answer
84
views
How to grep multiple words from a remote file in a SSH command to a target server
I wanted to execute the below command. I have a file with server names.
for i in \`cat /tmp/srv_list\`; do ssh $i "uname -a; uptime; grep -E "warn|error|failed|issues" /var/log/...