Questions tagged [shell]
A shell is software that lets users interact with the operating system, usually by typing at a command-line.
4,055
questions
5
votes
3
answers
3k
views
Windows Explorer: Customize view settings via batch or shell-extension?
In folders with shortcuts (and junctions) I oftenly like to have mid-sized icons, sorted names and grouping by type. Alas, Explorer oftenly forgets these settings once I made them manually.
The ...
1
vote
2
answers
5k
views
The "shmmax" value is too large when installing Oracle 11g on RHEL7
I am trying to install Oracle Database 11g Release 2 on RHEL 7.2. Executing runfixup.sh, it outputs:
# /tmp/CVU_11.2.0.1.0_oracle/runfixup.sh
Response file being used is :/tmp/CVU_11.2.0.1.0_oracle/...
1732
votes
10
answers
1.5m
views
How can I sort the output of 'ls' by last modified date?
How can I sort the output of ls by last modified date?
5
votes
2
answers
6k
views
Find files but exclude several directories?
How do I use find to list every single file but exclude a handful of directories from the search?
find / -type f -not -path "./foo*" -not -path "/bar*" -print
I've seen examples on other ...
67
votes
8
answers
91k
views
Full command text with unix ps
When we enter:
ps -f
... the CMD column text doesn't show the full command. Any way to prevent this truncating?
Seems like it's showing the first 80 characters. We are running a fairly ...
1
vote
1
answer
3k
views
Passing variables to docker run from within a bash shell, getting "unterminated quoted string" error
I have a bash shell with multiple variables that form the command options of a docker run command. I suspect a < character is breaking the config line that I am passing.
This is the command that I ...
1
vote
2
answers
3k
views
How to issue an rsh command to run in the background from a batch file?
How to issue an rsh command to run in the background?
Example:
Within a (Windows) batch file I call rsh 10.1.1.2 -lroot /etc/rtcinst/myscript.ksh,
which runs on a remote unix machine. This script ...
1
vote
3
answers
575
views
Is there a way to create a shortcut for a system shell virtual directory?
I wanted to quickly be able to access a system virtual directory, like the "Applications" folder (shell:AppsFolder)
Ive tried just running "shell:AppsFolder" inside a shortcut, but ...
108
votes
12
answers
251k
views
List open SSH tunnels
I use a lot of SSH tunnels to various servers on my linux machine (for tunnelling to databases, web servers etc) and it would be really handy to view a list of current open tunnels via a shell script. ...
0
votes
1
answer
62
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
0
answers
75
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 ...
0
votes
1
answer
61
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:...
1
vote
0
answers
38
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 ...
2
votes
2
answers
582
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 ...
105
votes
8
answers
122k
views
How can I find the oldest file in a directory tree
I'm looking for a shell one-liner to find the oldest file in a directory tree.
50
votes
10
answers
73k
views
Suppress execution trace for echo command?
I'm running shell scripts from Jenkins, which kicks off shell scripts with the shebang options #!/bin/sh -ex.
According to Bash Shebang for dummies?, -x, "causes the shell to print an execution trace"...
1
vote
2
answers
3k
views
Visual Studio Code not working with Zsh on Linux
If i try to use VS Code with zsh, it says "The terminal process command '/usr/bin/zsh' failed to launch (exit code: 1)".
First I tried to set '"terminal.integrated.shell.linux": "/bin/zsh"' in the ...
0
votes
1
answer
32
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} ...
1
vote
0
answers
201
views
Get macOS ping to only log timeouts
I have a similar case to: Generating usage logs that prove my Internet connection is flaky
However these logs will get long quickly. I am only interested in logging timeouts, is there a way to achieve ...
0
votes
0
answers
64
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/...
565
votes
16
answers
476k
views
Reload a Linux user's group assignments without logging out
When assigning a user's secondary group list using:
# usermod -G <grouplist> <user>
is it possible to force this group assignment to take effect without logging out all running sessions?
...
0
votes
2
answers
107
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/...
3
votes
3
answers
5k
views
Vim + iTerm2 color issues
I have trouble with the right Vim configuration. I'm using the latest version of Vim as well as the latest version of iTerm2.
I try to get the solarized colorscheme working, but without luck so far.
...
22
votes
6
answers
9k
views
is there an 'upwards' find?
I found I asked this question on the wrong stackexchange site.
To find files starting from a certain path, I can use find <path> .... If I want to find 'upwards', i.e. in the parent directory, ...
5
votes
2
answers
2k
views
zsh alias "..."
I have an ZSH alias:
alias -g ...='../..'
alias -g ....='../../..'
When I try to cd ..., things work perfectly. I can't, however, use it in a cp command: cp .../file . fails with cp: .../file: No ...
1
vote
4
answers
4k
views
How to truncate the streaming output of a redirect?
I have a process that outputs a line for every progress update (sidenote: it does clear/replace the line, no pure newline break).
I want to save the latest line of that process to an output file or ...
1
vote
2
answers
1k
views
Change the default location of zsh completion cache files for macOS
I'm trying to change the default location of the zsh completion cache files in macOS. I have read the zsh documentation on completion which say's "alternatively, an explicit file name can be ...
1
vote
2
answers
1k
views
Cannot use variable in FFmpeg command as I wanted
I am trying to do a basic hardsub work with FFmpeg in a Powershell script. Here is the code:
$subfile = ".\test\sub.srt"
ffmpeg -i in.mp4 -c:v h264 -vf "subtitles=${subfile}:'force_style=fontsize=20'...
2
votes
0
answers
79
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
125
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 ...
2
votes
3
answers
4k
views
How to extract characters between first and second underscores of filenames and count such files in Linux folder?
I would like to extract characters between first and second underscores of filenames in a folder and count such type of files present in it.
The folder contains files in a particular format such as:
...
4
votes
2
answers
9k
views
Unable to login as root or as user because zsh is missing
I installed zsh on my raspberry pi and for various reasons including the fact that the shell completely slowed down, I decided to remove it. I uninstall the package, changed the shell back to /bin/...
0
votes
0
answers
15
views
gnu screen title cannot be configured
I use shelltitle command in the .screenrc, but no matter what I set it, the new windows created are always having a default title, in the form of shell prompt, user@hostname:cwd, what is wrong with ...
1
vote
1
answer
18k
views
Startup issues possibly startup.nsh in EFI shell
I have a mini PC that always boots into Windows no matter what boot order is set in UEFI. I thought there was a startup script on ESP/EFI partition that was overwriting the boot order at every startup ...
11
votes
9
answers
10k
views
Remove blank pages from PDF from command line
I have a PDF that has some blank pages inserted. These pages are the background colour (grey in this case). I would like to remove these pages using a bash script.
It has been suggested that we can ...
3
votes
3
answers
6k
views
How to check if busybox has a command?
In my case, I want to see if busybox has "md5sum" builtin.
I am currently doing this:
$ echo | busybox md5sum &>/dev/null && echo yes || echo no
I have not been able to find any ...
1
vote
2
answers
185
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 ...
2
votes
1
answer
64
views
How does symlink from shutdown to systemctl work?
which shutdown
returns
/usr/bin/shutdown
I also tried sudo which shutdown just in case...but got the same result.
I can see that
lrwxrwxrwx 1 root root 9 Dec 13 03:38 /usr/bin/shutdown -> ...
61
votes
9
answers
297k
views
How to display current path in command prompt in linux's sh (not bash)?
I would like to display current path in sh prompt (not bash shell), which currently just shows "#",
I tried with introducing this
env PS1="$(whoami)@$(hostname):$(pwd)"
and
set PS1="$(whoami)@$(...
12
votes
3
answers
7k
views
Is there a folder-specific .bashrc or .bash_profile?
Is it possible to have a bash script (like a .bashrc or .bash_profile, basically) that is executed only upon cd’ing into a specific folder?
47
votes
4
answers
130k
views
The application “SomeApp.app” can’t be opened
Problem: after downloading an application in OS X Yosemite (10.10.x) trying to open the application (either from the command-line or by double-clicking the application) produces a dialog saying "The ...
0
votes
3
answers
4k
views
ip namespace non-root shell
I am trying to run ssh command to another ip namespace. I can do it right now, but it runs as root. I want to run it as a normal user. I want to know if there is a way to enter a non-root shell in ...
3
votes
1
answer
4k
views
Why can I access the internet in a browser but not the terminal?
I can browse the internet using Chrome and Safari, but when I use the terminal, I can not. When I try to ssh in the terminal, I get "request timed out" and when I try to ping I get "3 packets ...
23
votes
1
answer
4k
views
one sudo for multiple terminals
Sudo root permissions are given for specific time, but only for one terminal. If I want to use sudo in another terminal in that time period, I have to type password again. How to force sudo to works ...
0
votes
1
answer
6k
views
ksh Auto-Completion PuTTY Configuration
I'm having a bit of a problem configuring my PuTTY client to work with the auto-completion feature in the ksh shell.
I do a listing on the root with the directories /home and /homeroot and it returns ...
0
votes
2
answers
4k
views
Linux zip and exclude directory in Bash script
I am trying to write a bash/shell script to zip up a specific folder and ignore certain sub-dirs in that folder.
This is the folder I am trying to zip "sync_test5":
My bash script generates an ...
9
votes
2
answers
6k
views
UTF-8 locale portability (and ssh)
I spend a lot of my time sshed into various machines, all of which are different (some are embedded, some run Linux, some run BSD, &c.). On my own local machines, however, i use OS X, which of ...
1
vote
1
answer
134
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
2
answers
9k
views
Using find with -exec gzip and grep
I have a bunch of zipped up log files and I want to search them all for a string. I tried this but it's not working:
find ./ -name "*.log.zip" -exec gzip -dc {} | grep ERROR \;
It's giving me:
...
3
votes
3
answers
2k
views
How to setup zsh to append history to a file named dynamically by date
My biggest sticking point moving from bash to zsh is the history configuration. Using oh-my-zsh there is a history.zsh file in #ZSH/lib that I found (I think) can be disabled via unsetopt ...