Questions tagged [fish]

Fish is a unix shell with a clean design and a limited but powerful feature set.

Fish (friendly interactive shell) is a relatively new unix . It provides advanced interactive features such as command and argument completion, and syntax coloring. Fish has a simpler syntax than Bourne-style shells.

Links and documentation

231 questions
270
votes
13 answers

Execute a command once per line of piped input?

I want to run a java command once for every match of ls | grep pattern -. In this case, I think I could do find pattern -exec java MyProg '{}' \; but I'm curious about the general case - is there an easy way to say "run a command once for every line…
Xodarap
  • 3,613
  • 3
  • 20
  • 16
61
votes
3 answers

Does Bash have similar features such as Fish's autosuggestions and highlighting?

I recently noticed 2 features in Fish and was wondering if anyone knew if these were also available in Bash? Syntax highlighting Specifics: You'll quickly notice that fish performs syntax highlighting as you type. Invalid commands are colored red…
slm
  • 363,520
  • 117
  • 767
  • 871
50
votes
3 answers

How to make zsh completion show the first guess on the same line (like fish's)?

In Fish when you start typing, autocompletion automatically shows the first autocompleted guess on the line itself. In zsh you have to hit tab, and it shows the autocompletion below. Is there anyway to make zsh behave more like fish in this…
korylprince
  • 1,811
  • 2
  • 14
  • 12
29
votes
10 answers

Dealing with file names with special first characters (ex. ♫)

I have recently come across a file whose name begins with the character '♫'. I wanted to copy this file, feed it into ffmpeg, and reference it in various other ways in the terminal. I usually auto-complete weird filenames but this fails as I cannot…
ZirconCode
  • 513
  • 1
  • 5
  • 14
25
votes
5 answers

What's the easiest way to detect what signals are being sent to a process?

I'm trying to debug an issue with my shell (specifically, fish) sending signals to my background processes. I'd like to be able to recognize what signals a process is receiving. Ideally, I'd like some program that would do something like this: $…
Alexis King
  • 555
  • 1
  • 4
  • 15
25
votes
7 answers

Share environment variables between bash and fish

bash and fish scripts are not compatible, but I would like to have a file that defines some some environment variables to be initialized by both bash and fish. My proposed solution is defining a ~/.env file that would contain the list of environment…
Tyilo
  • 5,891
  • 12
  • 47
  • 61
21
votes
2 answers

how do I reference a variable in fish shell with a default fallback

What is the fish shell equivalent to the following bash: echo ${TEST:-1} In bash this would print the value of TEST if there was one, or 1 if there was not.
Scott B
  • 311
  • 2
  • 4
21
votes
1 answer

How to change the default shell in NixOS?

At the moment I need to set the fish shell to be my default shell on NixOS and there is no official documentation on how to do that declaratively (not by running chsh) in NixOS.
Sridhar Ratnakumar
  • 883
  • 1
  • 7
  • 17
18
votes
3 answers

How to access bash aliases in fish

I am missing my bash aliases in fish, and don't want to manually convert all of them to fish functions. How to get access to them all from within fish? Bonus points if: the solution supports an iterative process, as in: i can easily change the…
hoijui
  • 611
  • 1
  • 6
  • 14
17
votes
1 answer

Run a command only if the previous command was successful in Fish (like && in bash)

Using Bash I've often done things like cd /study && ls -la I understand that the double ampersand is telling the terminal don't execute part two of this command unless part one completes without errors. My question is, Having just moved to the Fish…
Nathaniel
  • 430
  • 4
  • 9
16
votes
2 answers

Why can't I list a directory with read permissions?

I created a directory d and a file f inside it. I then gave myself only read permissions on that directory. I understand this should mean I can list the files (e.g. here), but I can't. will@wrmpb /p/t/permissions> ls -al total 0 drwxr-xr-x 3 will …
wrgrs
  • 917
  • 1
  • 7
  • 11
14
votes
2 answers

How to edit the fish shell startup script?

Is there a way I can do something like run myscript.sh in fish ? I am using Arch Linux, and have installed the fish shell together with oh-my-fish Can someone tell me which file I must edit to add my custom shell startup commands? In zsh it was the…
Mr Mixin
  • 243
  • 1
  • 2
  • 5
13
votes
2 answers

Fish-Shell Will Not Save my Aliases

I do not know why, but after making a whole bunch of fish aliases. I'm assuming I have neglected one simple step after assigning them all but I cannot seem find the solution myself. Can anyone lend me a hand? Thank you very much! ~Ev
Ev-
  • 619
  • 1
  • 5
  • 15
11
votes
2 answers

How does history work in fish shell?

I'm a bash user, starting a new job at a place where people use fish shell. I'm looking at the history command which I often use in bash. When I use it in fish I get a long list of my history which I can scroll up and down on with the arrow…
Philip Kirkbride
  • 9,816
  • 25
  • 95
  • 167
11
votes
5 answers

fish: sudo: !!: command not found

I have fish installed in my Linux Mint DE. I really like how fish makes things easier and it looks so pretty although I haven't find a correct answer about why I can't execute: sudo: !!: command not found At first I tried to escape the exclamation…
VaTo
  • 3,071
  • 3
  • 18
  • 47
1
2 3
15 16