this post was submitted on 15 Sep 2025
369 points (98.4% liked)

Linux

58281 readers
487 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by AlpΓ‘r-Etele MΓ©der, licensed under CC BY 3.0

founded 6 years ago
MODERATORS
 

I've been trying nushell and words fail me. It's like it was made for actual humans to use! 🀯 🀯 🀯

It even repeats the column headers at the end of the table if the output takes more than your screen...

Trying to think of how to do the same thing with awk/grep/sort/whatever is giving me a headache. Actually just thinking about awk is giving me a headache. I think I might be allergic.

I'm really curious, what's your favorite shell? Have you tried other shells than your distro's default one? Are you an awk wizard or do you run away very fast whenever it's mentioned?

top 50 comments
sorted by: hot top controversial new old
[–] DieserTypMatthias@lemmy.ml 13 points 3 days ago (1 children)
[–] Magnum@lemmy.dbzer0.com 7 points 2 days ago (1 children)
[–] dessalines@lemmy.ml 5 points 2 days ago

Vegans can use fish, as long as they don't bash

[–] syklemil@discuss.tchncs.de 51 points 4 days ago (2 children)

I've been using fish (with starship for prompt) for like a year I think, after having had a self-built zsh setup for … I don't know how long.

I'm capable of using awk but in a very simple way; I generally prefer being able to use jq. IMO both awk and perl are sort of remnants of the age before JSON became the standard text-based structured data format. We used to have to write a lot of dinky little regex-based parsers in Perl to extract data. These days we likely get JSON and can operate on actual data structures.

I tried nu very briefly but I'm just too used to POSIX-ish shells to bother switching to another model. For scripting I'll use #!/bin/bash with set -eou pipefail but very quickly switch to Python if it looks like it's going to have any sort of serious logic.

My impression is that there's likely more of us that'd like a less wibbly-wobbly, better shell language for scripting purposes, but that efforts into designing such a language very quickly goes in the direction of nu and oil and whatnot.

[–] Overspark@piefed.social 9 points 4 days ago

nu 's commands also work on JSON, so you don't really need jq (or xq or yq) any more. It offers a unified set of commands that'll work on almost any kind of structured data.

[–] phantomwise@lemmy.ml 7 points 4 days ago (3 children)

That's interesting I hadn't thought about the JSON angle! Do you mean that you can actually use jq on regular command outputs like ls -l?

Oil is an interesting project and the backward compatibility with bash is very neat! I don't see myself using it though, since it's syntax is very close to bash on purpose I'd probably get oil syntax and bash syntax all mixed up in my head and forget which is which... So I went with nushell because it doesn't look anything like bash. If you know python what do you think about xonsh? I

load more comments (3 replies)
[–] apt_install_coffee@lemmy.ml 14 points 3 days ago

I used nushell for a good 6 months, it was nice having structured data, but the syntax difference to bash which I use for my day job was just too jarring to stick with.

Fish was (for me) the right balance of nice syntactic sugar and being able to reasonably expect a bash idiom will work.

[–] JackbyDev@programming.dev 2 points 2 days ago (2 children)

I feel like if I was forced to use PowerShell I'd fall in love with it and want to use it on Linux. Passing objects between commands instead of text sounds amazing. So many (Linux) shell commands use slightly differently shaped text, it's annoying. New line separated? Tab separated? Null separated? Comma separated? Multiple fields? JSON? And converting between them all and using different flags to accept different ones is just such a headache.

[–] brax@sh.itjust.works 2 points 2 days ago

PowerShell's import-csv and export-csv are too dang powerful. Doing batch processing in PS is so cool.

[–] djehuti@programming.dev 1 points 1 day ago (1 children)

I was under the impression that it was available on Linux?

[–] JackbyDev@programming.dev 1 points 1 day ago

It is, but I know myself and realistically unless I'm forced to learn it in an environment where it's first class I'm not going to use it on a regular basis.

[–] communism@lemmy.ml 24 points 4 days ago (4 children)

Nushell looks cool but I prefer to stick with the POSIXes so that I know my scripts will always work and syntax always does what I expect it to. I use zsh as a daily driver, and put up with various bashes, ashes, dashes, that come pre-installed with systems I won't be using loads (e.g. temporary vms).

[–] nimpnin@sopuli.xyz 26 points 3 days ago (10 children)

Always confuses me when people say this. You can use multiple different shells / scripting languages, just as you can use multiple programming languages.

[–] communism@lemmy.ml 9 points 3 days ago

I know that. I just don't have a use case for alternative shells. Zsh works fine for me and I know how it works. I don't have problems that need fixing, so I don't need to take the time to learn a new, incompatible shell.

[–] elmicha@feddit.org 7 points 3 days ago (3 children)

Some people work on machines where they are not allowed to install anything.

load more comments (3 replies)
load more comments (8 replies)
[–] Aatube@kbin.melroy.org 18 points 4 days ago (6 children)

Your scripts should have Bourne shebangs

[–] syklemil@discuss.tchncs.de 10 points 3 days ago* (last edited 3 days ago)

Yeah, there should be a clear separation between scripts, which should have a shebang, and interactive use.

If a script starts acting oddly after someone does a chsh, then that script is broken. Hopefully people don't actually distribute broken script files that have some implicit dependency on an unspecified interpreter in this day and age.

load more comments (5 replies)
[–] phantomwise@lemmy.ml 11 points 4 days ago (4 children)

I don't really mind having a non-POSIX shell since it doesn't prevent bash scripts from working, but I get that if you want portability bash is still best since it'll work mostly anywhere.

load more comments (4 replies)
load more comments (1 replies)
[–] priapus@piefed.social 13 points 3 days ago

I love Nushell, it's so much more pleasant for writing scripts IMO. I know some people say they'd just use Python if they need more than what a POSIX shell offers, but I think Nushell is a perfect option in between.

With a Nushell scripts you get types, structured data, and useful commands for working with them, while still being able to easily execute and pipe external commands. I've only ever had two very minor gripes with Nushell, the inability to detach a process, and the lack of a -l flag for cp. Now that uutils supports the -l flag, Nushell support is a WIP, and I realized systemd-run is a better option than just detaching processes when SSHd into a server.

I know another criticism is that it doesn't work well with external cli tools, but I've honestly never had an issue with any. A ton of CLI tools support JSON output, which can be piped into from json to make working with it in Nushell very easy. Simpler tools often just output a basic table, which can be piped into detect columns to automatically turn it into a Nushell table. Sometimes strange formatting will make this a little weird, but fixing that formatting with some string manipulation (which Nushell also makes very easy) is usually still easier than trying to parse it in Bash.

[–] GooseFinger@sh.itjust.works 8 points 3 days ago (1 children)

I'm an absolute Linux tard, so it's hilarious to me trying to read and understand most of these comments

[–] UltraGiGaGigantic@lemmy.ml 3 points 2 days ago

Everyone was a newbie at one point

[–] Ferk@lemmy.ml 22 points 4 days ago* (last edited 4 days ago) (2 children)

I prefer getting comfortable with bash, because it's everywhere and I need it for work anyway (no fancy shells in remote VMs). But you can customize bash a lot to give more colored feedback or even customize the shortcuts with readline. Another one is pwsh (powershell) because it's by default in Windows machines that (sadly) I sometimes have to use as VMs too. But you can also install it in linux since it's now open source.

But if I wanted to experiment personally I'd go for xonsh, it's a python-based one. So you have all the tools and power of python with terminal convenience.

load more comments (2 replies)
[–] Fontasia@feddit.nl 15 points 3 days ago (1 children)

That looks a lot like PowerShell

[–] underscores@lemmy.zip 10 points 3 days ago (1 children)

PowerShell without the awful syntax

[–] brianary@lemmy.zip 7 points 3 days ago

What awful syntax?

Ffs bash uses echo "${filename%.*}" and substring=${string:0:5} and lower="${var,,}" and title="${var^}" &c. It doesn't use $ for assignment, only in expressions.

[–] LaggyKar@programming.dev 17 points 4 days ago (4 children)

Looks like it's taken a page from PowerShell in passing structured data rather than just text.

[–] Overspark@piefed.social 21 points 4 days ago (1 children)

Yeah, it has. I think they started out as loving the concepts of PowerShell but hating the implementation, combined with the fact that PowerShell is clearly a Windows-first shell and doesn't work so well on other OSes (it surprised me a lot to find out that PowerShell even has support for linux).

nu tries to implement these concepts in a way that's more universal and can work equally well on Linux, macOS or Windows.

Powershell works really well on other OSs now. I use it on MacOS and Linux daily. I might loath MS but Powershell is a fantastic shell and after working with an object-oriented shell I hate going back to anything else.

load more comments (3 replies)
[–] Obin@feddit.org 11 points 3 days ago

I’m really curious, what’s your favorite shell?

Emacs eshell+eat

It essentially reverses the terminal/shell relationship. Here, it's the shell that starts a terminal session for every command. Eshell is also tightly integrated with Emacs and has access to all the extended functionality. You can use Lisp in one-liners, you can pipe output directly to an emacs buffer, you can write custom commands as lisp functions, full shortcut customization not limited to terminal keys, history search via the completion framework (i.e. consult-history), easy prompt customization, etc.

There's also Tramp, which lets you transparently cd into remote hosts via ssh, docker containers, SMB/NFS-shares, archive files, and work with them as if they were normal directories (obviously with limited functionality in some cases, like archives).

And probably a lot of stuff I'm missing right now.

[–] DasFaultier@sh.itjust.works 12 points 4 days ago* (last edited 4 days ago) (7 children)

(...) 'cause it was quarter part eleven

on a Saturday in 1999

🎢🎢

To answer your questions, I work on the Bash, because it's what's largely used at work and I don't have the nerve to constantly make the switch in my head. I have tried nushell for a few minutes a few months ago, and I think it might actually be great as a human interface, but maybe not so much for scripting, idk.

load more comments (7 replies)
[–] bastion@feddit.nl 10 points 3 days ago* (last edited 3 days ago) (6 children)

I like nushell, but I love xonsh. Xonsh is the bastard love child of Python and Bash.

it can be thought of as:

  • try this statement in Python
  • if there's an exception, try it in bash.

Now, that's not a very accurate description, because the reality is more nuanced, but it allows for things like:

for file in !(find | grep -i '[.]mp3^'):
    file = Path(file.strip())
    if file != Path('.') and file != file.with_suffix('.mp3'):
    mv @(file) @(file.with_suffix('.mp3'))

Now, there are things in there I wouldn't bother with normally - like, rather than using mv, I'd just use file.rename(), but the snippet shows a couple of the tools for interaction between xonsh and sh.

  • !(foo) - if writing python, execute foo, and return lines
  • @(foo) - if writing sh, substitute with the value of the foo variable.

But, either a line is treated in a pyhony way, or in a shelly way - and if a line is shelly, you can reference Python variables or expressions via @(), and if it's Pythony, you can execute shell code with !() or $(), returning the lines or the exact value, respectively.

Granted, I love python and like shell well enough, and chimeras are my jam, so go figure.

load more comments (6 replies)
[–] Cat_Daddy@hexbear.net 10 points 4 days ago

I've had nushell as my daily driver for a couple years now and I love it. "Made for actual humans to use" is exactly the description I'd give.

[–] calliope@retrolemmy.com 9 points 4 days ago* (last edited 4 days ago) (2 children)

I use zsh, mainly because I’ve been using it for a really long time and it felt like an upgraded bash.

I also have used fish a tiny amount and like the idea but zsh just works for my purposes and I already know how it works.

nushell looks really cool though!

I don’t have much occasion to use awk any more but it can be really useful!

load more comments (2 replies)
[–] ronigami@lemmy.world 6 points 3 days ago (2 children)

Until you discover nushell’s (lack of) quoting rules

load more comments (2 replies)
[–] MonkderVierte@lemmy.zip 8 points 4 days ago (6 children)
[–] Oinks@lemmy.blahaj.zone 11 points 4 days ago* (last edited 4 days ago) (1 children)

The usual problems with parsing ls don't happen here because Nu's ls builtin returns properly typed data. You can work with it in pretty much the same way you would work with it in Python, except that Nu has a composition operator that doesn't suck ass (|), so you don't have to write as much imperative boilerplate.

I have a number of reservations regarding Nu (the stability of the scripting language, unintuitive syntax rules, a disappointing standard library) but this particular argument just doesn't apply.

load more comments (1 replies)
load more comments (5 replies)
[–] ArseAssassin@sopuli.xyz 7 points 4 days ago

Love nushell. It's just about the most practical functional programming language I've ever had the pleasure of using.

I'm using fish as my default shell since it's more standards-compliant and plays nicer with tools that modify your environment. But any time I need to do more complicated shell scripting, I'm breaking out nushell.

load more comments
view more: next β€Ί