Skip to main content

Questions tagged [shell]

A shell is software that lets users interact with the operating system, usually by typing at a command-line.

Filter by
Sorted by
Tagged with
0 votes
1 answer
41 views

How to disable row highlighting on iterm and oh-my-zsh?

I just setup the new Macbook today and start to have the weird highlighting with the blue frame on the row when i use my mouse to select a particular row on the terminal. The other row will be faded a ...
Thai Tran's user avatar
  • 131
0 votes
1 answer
57 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 ...
user312307's user avatar
0 votes
0 answers
14 views

Run a command, immediately return to the shell prompt, do not return a message when the command is finished [duplicate]

brew install gh > /dev/null 2>&1 & This returns to the shell immediately, but prints [1] + done brew install gh > /dev/null 2>&1 when the command finishes. brew install ...
Julius Hamilton's user avatar
0 votes
0 answers
32 views

Postfix being restarted

I have a script that submits form data to my email that works on local host, but not on the server. main.cf: # See /usr/share/postfix/main.cf.dist for a commented, more complete version # Debian ...
Adi Mehmedičević's user avatar
0 votes
1 answer
30 views

ChromeOS - after update, segmentation fault for all shell commands

My current version: That's what I'm getting when I type shell in ChromeOS terminal (Ctrl + Alt +T): I also noticed I'm not able to use any command, for example: What can I do to fix that? Without ...
user1209216's user avatar
0 votes
1 answer
60 views

Shell script gives "command not found" but command works in terminal

I'm using the beets cli music library management software on my Mac. It works fine in the the terminal - commands like beet import ~/path/to/folder work fine and which beet outputs /opt/local/bin/beet....
simonw's user avatar
  • 3
0 votes
1 answer
99 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 ...
MNIA's user avatar
  • 1
0 votes
1 answer
49 views

Execute a remote shell script from within screen via SSH and view stdout in one command

Couldn't find an answer for my particular use-case in the hours I've unsuccessfully researched this. I have a script located on machine B. I am aiming to run a command on machine A that establishes an ...
DeathToMediocrity's user avatar
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@...
user1917670's user avatar
0 votes
0 answers
40 views

Connect to PEAP wifi network on mac with a shell script

I am making a shell script for my mac and part of it requires connecting to my school's wifi network. I have tried both of the following commands and while the settings wifi tab says that the computer ...
Nicholas Parker's user avatar
0 votes
0 answers
61 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 ...
CaptainCsaba's user avatar
1 vote
2 answers
83 views

Show long commands in fish (ctrl+r) history on multiple lines

I'm looking for a solution to searching history with fish when your history is full of long commands. I often have curl commands that contain json payloads in my history that I want to repeat, for ...
Anthony Naddeo's user avatar
1 vote
1 answer
249 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, ...
Silas's user avatar
  • 39
0 votes
1 answer
180 views

How to disable MOTD from Debian 12?

I am looking to disable MOTD on my Debian 12 systems. I updated my sshd_config file to not display MOTD but it is still showing up. Is it possible it is coming from another module and how can I ...
themegamenuguy99's user avatar
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 ...
Cobra Kai Dojo's user avatar
0 votes
1 answer
107 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. ...
Dave's user avatar
  • 1
2 votes
2 answers
67 views

Avoiding accidental execution of python scripts as bash scripts

I like to run my python scripts directly in bash like so $ ./script.py But sometimes I forget the shebang line #!/usr/bin/env python3, and it has the potential to overwrite a file named np if the ...
user1537366's user avatar
0 votes
1 answer
73 views

Why do string variables in a bash script behave differently when echo'ed than they do when passed to an executable?

I have the following script: #!/bin/bash KID3=$(command -v kid3-cli) ARG1="-c 'get'" file="'1-01 - Johann Strauss - __Waldmeister___ Ouverture.flac'" echo Command: echo "$...
Frank van Wensveen's user avatar
0 votes
1 answer
99 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; ...
RansuDoragon's user avatar
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 ...
vlad_tepesch's user avatar
0 votes
0 answers
101 views

Can you write a script that contains both bash (or sh) and powershell (or cmd, bat) so the same file can be executed on Win and *nix?

I have a script that needs to run on Windows, Linux and MacOS. I know Windows determines how to run a script by using the file extension, where *nix will use the #!. I'm hoping there is enough syntax ...
David Alsh's user avatar
0 votes
0 answers
72 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 ...
kerblue's user avatar
2 votes
1 answer
103 views

Execute self-extracting bash script (with binary data appended) w/o saving it first

I have a self-extracting bash script (binary data appended to the end) like this: #!/bin/bash export TMPDIR=$(mktemp -d) ARCHIVE_START_LINE=$(...) # <omitted> # extracting data archive into a ...
Edward Ruchevits's user avatar
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 ...
Rob's user avatar
  • 103
0 votes
0 answers
164 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 ...
DevOPs's user avatar
  • 1
0 votes
1 answer
51 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 ...
joseph22's user avatar
  • 367
0 votes
2 answers
41 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 ...
Epsilon's user avatar
  • 103
0 votes
1 answer
154 views

tar on Windows does not handle paths with special characters

On a Windows 10 command line, creating a tar archive with "special" characters (e.g. extended latin) in the path of the archive itself results in errors. To be slightly more exact, a quick ...
djvg's user avatar
  • 136
0 votes
0 answers
151 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 ...
chickenchaser4343's user avatar
0 votes
1 answer
45 views

no-ignore-case in grep command

In man page of grep --no-ignore-case matching control has the following description: Do not ignore case distinctions in patterns and input data. This is the default. This option is useful for ...
tahzibi.jafar's user avatar
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 ...
MRule's user avatar
  • 285
1 vote
1 answer
146 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/...
FrederikVds's user avatar
0 votes
0 answers
591 views

How can fzf's command history search always be shown, automatically and without CTRL-R?

With fzf you can press CTRL-R to have a command history search box shown below the prompt and fuzzy search. I want it shown automatically for each new prompt, without having to press CTRL-R.
Oneechan69's user avatar
1 vote
0 answers
25 views

Pathname or word too long in Cshell

I am using cshell. And I know that there is a limit of 1024 character while setting path. But I have many path variables which I need to set. So, it is exceeding 1024 characters and I am getting an ...
Subhadip's user avatar
  • 111
0 votes
0 answers
40 views

How can I complete individual command line phrases / do partial completion with fzf?

With fzf I can press CTRL-R to search my command history but it completes the whole command. What I'd like is to just complete the current argument, the next phrase before the next space. Can this be ...
Oneechan69's user avatar
1 vote
0 answers
25 views

Copy interactive command outputs from Terminal to MacOS clipboard programmatically

Developing this answer, which offers a way to copy a given line from standard output to MacOS clipboard – I wonder if there's a way to do the same for interactive commands? For example: ~ bc -l >&...
Dmitrii Kuznetsov's user avatar
1 vote
1 answer
288 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 ...
beepbeepboop's user avatar
1 vote
0 answers
131 views

WSL run a non-login shell even with `--shell-type login`

Previously running wsl sourced .profile for me, as expected: As of build 16188 when running bash.exe without arguments (or with the ~ argument) bash will be launched as a login shell. The same is ...
Alexey Romanov's user avatar
0 votes
0 answers
81 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-...
Abir Halder's user avatar
1 vote
1 answer
106 views

What does it mean to "run something in a shell profile"

I'm installing Homebrew and I get a message that says: Next steps: ⁃ To add Homebrew to your PATH run brew shellenv in your shell profile (e.g. ~/.bash_profile or ~/.zprofile)" What does it ...
dkv's user avatar
  • 193
2 votes
0 answers
54 views

Setting GitHub Actions Secrets on Docker container build/run command, but encountering a parsing issue

I'm in the early stages of building an automated pipeline. Still in the exploring phase. Right now, I'm struggling with setting the environment variables for the container I'm going to run my app. The ...
Jorge Mauricio's user avatar
0 votes
1 answer
122 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, ...
Zsar's user avatar
  • 293
0 votes
0 answers
133 views

Cannot activate Python virtual environment from within shell script (zsh)

I cannot activate a Python virtual environment from within a shell script (zsh). I have tried the following: #!/bin/zsh conda create -n myenv python=3.10 conda activate myenv It sends me the error ...
NilsK's user avatar
  • 155
0 votes
1 answer
84 views

Script to install Anaconda and update conda

I want to write a shell script (zsh) that does the following: Installs Anaconda via Homebrew. Adds conda to PATH in .zshrc. Updates conda base environment. I have come up with the following solution:...
NilsK's user avatar
  • 155
1 vote
0 answers
44 views

Grub script how to remove menuentries

I made a grub script to detect bootable disks and show them on grub menu. It is working but I want to put a rescan button and to make that first I need to remove old menuentries. How can I do? My ...
0x01010's user avatar
  • 111
2 votes
2 answers
1k views

Is it possible to replace the Windows shell with Steam to launch to Big Picture faster, and have Explorer.exe load after Steam launches automatically?

I have a Steam Deck which I dual-booted to Windows. I'm trying to accomplish a facsimile to "game mode" on Steam OS. I want to boot to big picture automatically/extremely quickly so it ...
jazir5's user avatar
  • 21
0 votes
1 answer
66 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} ...
superAnnoyingUser's user avatar
0 votes
0 answers
67 views

Unsure what happening with my terminal but I'm getting a weird response

Whenever I run a python file, (vs code) or even open my terminal on mac I get a warning saying. /Users/ABC/.zshrc:1: command not found: “alias /Users/ABC/.zshrc:2: command not found: “alias /Users/ABC/...
Angus_U22's user avatar
0 votes
2 answers
172 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/...
aarondiel's user avatar
  • 101
2 votes
0 answers
100 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 ...
J-Cake's user avatar
  • 261

1
2 3 4 5
82