All Questions
1,671
questions
0
votes
0
answers
11
views
Keyboard doesn't work correctly when booting the linux kernel with single mode from CFE bootloader using UART
I've been encountering a specific and weird bug that i honestly can't seem to find any solution for, i've been toying around with this blu ray player and found a uart port, i wire it to my pi pico ...
1
vote
1
answer
64
views
store available disks for LVM in array
I am using lsblk command to get the device names on linux servers. However, I want to find the command that will help me scan the devices and store the results in an array only for devices that are ...
0
votes
1
answer
112
views
ls -ltr on the terminal lists the files but says "No such file or directory" in a shell script
I am new to Bash and am practicing some shell scripts. I wanted to write a script to list all the folders and their file count, if a root path is passed as a parameter value from the terminal. The ...
0
votes
0
answers
13
views
"find" command does not find all files from root unless folder is specified [duplicate]
I am trying to find the files that are named setenv.sh on this machine, I am logged in as root and am searching from the '/' using the following syntax and receiving the output:
# First
[root@...
0
votes
0
answers
75
views
VLC: Split Video onto Two Displays with Command
I need to display a video on two screens with VLC by command, in a non-manual way on my Raspberry PI.
The two screens are each connected by a HDMI cable. The video files have the 3840 * 1080 ...
1
vote
1
answer
328
views
Complete overview of Bash and Zsh startup files sourcing order
I was confused in what order my shells source which files. When researching this for myself, I came across several sources online and even read some parts of the manuals for both shells. But still, ...
0
votes
1
answer
33
views
sed does not consume rest of the line
I have one line of different words stored in a txt file
N/A 9.0 Yes Yes N/A N/A N/A N/A 8.8 Yes Yes N/A N/A N/A N/A 8.7 Yes Yes N/A N/A N/A N/A 9.2 Yes Yes Yes Yes Yes Yes 9.1 Yes Yes Yes Yes Yes Yes ...
0
votes
1
answer
129
views
Linux Bash Wait Command Not Working
I am trying to use and bash file .sh to start other bash files in seperate terminals.
I want them to run one after the other as I use them to copy large numbers of files to the same Hard Drive. ...
0
votes
1
answer
127
views
How do I find files by last day in a month? (or how to copy the latest file per month)
I know there is "find" and I use something like find "/backup.stats/30days" -mtime +30 -type f But I wanted to know if anyone knew of a way to pick out the oldest file by month; ...
0
votes
2
answers
29
views
linux zsh forge alias for clear that prints executed commandline
I often find myself putting a clear; in front of a command that I expect to produce lot of output.
That I regularly miss is the possibility to see the executed commandline at top.
Is there some magic ...
0
votes
0
answers
82
views
How to launch another blank terminal in Kali Linux?
When I launch another terminal in Kali Linux with Cmd+Shift+T, I can see Shell No. 2 tab created.
However, it is just a copy of Shell No. 1 and all the commands I ran on Shell No. 1 are visible on ...
10
votes
4
answers
2k
views
Why does assigning a variable with command substitution, and then echoing that variable, always fail?
Why does the following not work in Bash?
# Ensure TEST is unset
export TEST=''
echo "Hello world!" > test.txt && TEST="$(cat test.txt)" echo "$TEST"
It always ...
0
votes
0
answers
201
views
how to use curl for single sign-on website or page
I've already written a shell script but it's not working. I'm getting an empty response whereas it should first return a token and also it should login then register the API.
That's the task which my ...
0
votes
1
answer
58
views
How to simply cleanup a filename?
OS: Kubuntu 22.04.4 LTS x86_64
to display above:
neofetch --stdout |grep 'OS:'
.
How to simply cleanup a filename, not file contents?
by removing from a filename:
\n newlines
\t tabs
non printable ...
0
votes
2
answers
46
views
An incorrect path is displayed in my custom command line prompt in bash
I would like to display the current and parent directories in my Linux command prompt. For example, if the current directory is /home/user/proj/src, I'd like the prompt to display proj/src.
I found ...
0
votes
0
answers
179
views
Can I show multiple tmux sessions in one pane?
I have 5 node js scripts running, each in their own tmux session. I saw something completely unrelated a few days ago where someone was using tmux and they had like 6 different shells open on the same ...
0
votes
0
answers
31
views
How does Zotero find the information used to rename PDFs, and how can one incorporate this functionality into a shell script?
The bibliography management software Zotero can automatically rename manuscript PDFs in a AUTHOR - YEAR - TITLE.pdf format. Per this question, Zotero doesn't support batch-renaming all PDFs in a ...
1
vote
1
answer
161
views
How do I create a pty without a shell?
Backstory: I have a CLI Python application. I want to be able to debug it without interfering with the CLI of the main application. The Python debugger allows you to specify an alternative stdin/...
1
vote
1
answer
325
views
Default shell zsh but responding bin/bash
I have no idea what I did! I was installing maven and one of the guides had me do something and now I'm stuck in default zsh. I've tried changing my terminal preferences to be /bin/bash, as well as my ...
0
votes
0
answers
85
views
Run custom shell script through udev
I'm trying to make an udev rule that'll play sound upon connecting the charger. The rule seems to work fine except I can not get the shell script to run. This is my udev rule:
$cat 01-mru-battery-...
0
votes
1
answer
141
views
How to make bash script output compatible with both terminal and file?
In bash, if I want to produce periodical status messages, I can replace the previous one by emitting a hotkey combination, e.g. as seen here, here or here. When a user executes the script directly, ...
0
votes
1
answer
72
views
Loop of screens with a loop inside does not pick variable values
How can we execute a loop of screens, each of them executing a loop so that it picks both inner and outer variables?
Consider this:
# does not print i
for i in 1 2; do
screen -dmS screen-${i} ...
0
votes
2
answers
177
views
lvm: lvresize --resizefs does not read the request size in correctly
I am trying to resize a logical volume (as well as the filesystem contained on that volume) and am a little confused by the output of the lvresize command:
# lvresize --resizefs -L 2T /dev/archive/...
2
votes
0
answers
101
views
Program is not interactive in NuShell
Some background
Qemu has a wonderful feature, which allows you to connect its stdio streams to serial ports on the guest. This allows you to connect QEMU's stdio streams to a TTY shell on the guest ...
0
votes
0
answers
312
views
How to change the default shell for a vsphere.local user on a VMware VCSA server?
How to change the default shell for a vsphere.local user on a VMware VCSA 8 server (Photon OS/Linux 3.0) ?
I tried the chsh command but it does not work for a vsphere.local user :
PS C:\> ssh ...
1
vote
1
answer
243
views
Why is this tmux option not persisting?
I would like to generate a bashrc configuration file each time I start a particular tmux session, and I want to use my user's default tmux configuration file ${XDG_CONFIG_HOME}/tmux/tmux.conf as well. ...
0
votes
0
answers
160
views
How to run sh script in lxterminal using double click on Raspbian
I've read so many threads regarding running a script using double click, but none of the ways describes my case.
My operating system is Raspbian Bookworm (Debian), the graphical shell is LXDE and the ...
0
votes
1
answer
633
views
Play single mp3 through specific Pipewire device via shell command
I'm trying to figure out a way to play a single mp3 file through a specific Pipewire output device via a shell command.
Only this one file should be played through that device. I don't want to change ...
1
vote
1
answer
101
views
!$ not automatic in Kali Linux
Does anybody know how to change the behaviour of !$ in Kali Linux ? Right now, if I reference last argument using !$ I must enter the new command with the last argument instead of executing a new ...
0
votes
1
answer
103
views
linux + why command output cant be filter or can saved in file
clockdiff is command that measure clock difference between hosts
here is example from my Linux machine.
clockdiff -o 162.23.2.2
.
host=server11 rtt=750(187)ms/0ms delta=0ms/0ms Tue Oct 24 11:01:42 ...
0
votes
0
answers
294
views
~/.oh-my-zsh/oh-my-zsh.sh:17: parse error near `done'
I am keeping to have this error:
~/.oh-my-zsh/oh-my-zsh.sh:17: parse error near `done'
when I source ~/.zshrc...
This is the file ~/.oh-my-zsh/oh-my-zsh.sh
# ANSI formatting function (\033[<code&...
0
votes
1
answer
101
views
Difference between './file' and 'sh file'
On macOS, in the zsh terminal, I ran the following commands:
cd /tmp
mkdir newdir
cd newdir
touch file1
./file1
The last command returned
zsh: permission denied: ./file1
But running
sh file1
executed ...
0
votes
0
answers
2k
views
How to solve exec format error while running container in ECS?
Previously the question was related to https://stackoverflow.com/questions/77266768/yarn-command-not-found-after-successful-docker-build. It was fixed but my problem is related to using shell /bin/sh.
...
1
vote
1
answer
190
views
On Linux, how can one diff directories, excluding files by name, but including directories of the same name?
Consider the following dir/file structure (all leaf nodes are regular files, not that it really matters):
$ tree
.
├── cool_1
│ ├── dumb
│ │ ├── file1
│ │ └── file2
│ └── foo
│ └── ...
0
votes
1
answer
281
views
How to nicely print time difference in bash?
In my bash script, I want to print the time that my set of commands took to execute.
I'm doing this:
#!/bin/bash
start=$(date +%s)
./my-long-command.sh
./another-longcommand.sh
echo "Completed, ...
2
votes
2
answers
272
views
Linux: Where to define my aliases regardless of the shell being used?
I am using Void Linux in WSL with the fish shell. I want to define aliases, but I am not sure why they are not being executed. When I used zsh everything seemed to work.
I want the aliases to be ...
0
votes
2
answers
9k
views
How do I fix "Sudo commands will not succeed by default" on chromeOS Crosh Shell
I have been trying to install SeaBios for Ubuntu, and all of them say I need to use
Crosh Shell, every time I try to use it though it says "Sudo commands won't succeed by default" how can I ...
0
votes
1
answer
159
views
How to properly set sudo crontab to backup files with superuser rights nightly?
I'm writing a script to backup some dirs such as /etc in a nightly backup.
The script works if I run it manually and input a password, but fails to launch in crontab
For testing purpose I've made a ...
1
vote
1
answer
2k
views
Bash shell - shorter way to remove last characters from the file name
I can append a string to a filename without having to enter the repeating part of the command twice:
mv foo{,_bar}
And this renames my foo into foo_bar .
Is there a way to do the opposite - remove ...
0
votes
0
answers
204
views
get, using ffmpeg, the RTSP response code
It's possible get using the ffmpeg the RTSP response code?
I need collect the information from RTSP header, similar to the HTTP header. But using 'curl' i dont think it would be possible.
0
votes
1
answer
204
views
Double-clicking .sh file on KDE fails to run the script
I have a simple .sh script on my Desktop that fixes a minor annoyance with my second display. If I open Konsole, and type ./script.sh, it runs perfectly. But if I double click that .sh file - it fails ...
0
votes
1
answer
191
views
Linux RHEL 7 - Shell Script - Can execute command separately but cannot execute inside a script
I have a simple script use to install a package under cust privilege like this (command changed for security)
installScript.sh
#!/bin/bash
patch -i <package-name> << EOF
n
EOF
the purpose ...
0
votes
1
answer
2k
views
Linux RHEL 7 - Ansible - Execute command in shell is normal but got file not found/permission denied when run via script
I have an Ansible body as follow
- name: install
command: sh /installScript.sh
args:
chdir: /home/cust/
then I execute my playbook using this
ansible-playbook -i my_inventory....
1
vote
1
answer
913
views
XDG Base Directory environment variables not respected by notionally compliant software
The goal
I'm running Arch Linux. I want to store all config/data/cache/state files in subdirectories of ~/local, like so:
~
├── downloads
├── documents
└── local
├── data
├── state
├── ...
0
votes
0
answers
791
views
Reference shell Script within a shell Script in YAML
Is there the right way to reference a shell script written within a script in a YAML file. For eg:
data:
ex1.sh: |
#!/bin/bash -x
. /shellscriptloc/ex2.sh
...
...
0
votes
1
answer
836
views
ubuntu: how to check if a directory not exist or empty?
ubuntu: how to check if a directory not exist or empty?
if [not_exist "/path" || empty "/path"] then
command1;
else
command2;
fi
0
votes
0
answers
102
views
How do Linux terminal programs set up the environment for the shell program
I am writing a terminal emulator in Rust. The source is here. It forks itself and the child process (eventually) becomes the shell program which it reads output from and passes input to.
On macOS, ...
2
votes
0
answers
183
views
How to bypass hard-coded shared library file requirement?
I'm coding in a Linux server with no root permission, so using package manager to install package to root directory like yum install zsh is not available. Therefore I download package to my user ...
0
votes
1
answer
598
views
Running shell Script via Systemd.timer
So I've essentially run into the same problem as in my other question: Running shell Script via Crontab
I will now run my shell script with systemd.timer but it is not working so far.
Here is my ...
-1
votes
1
answer
904
views
I would Like to know what -sb and awk '{print $1}' role in this command
subdirectory_size=$(du -sb "$entry" | awk '{print $1}').
I would Like to know what -sb and awk '{print $1}' role in this command.