5
you are viewing a single comment's thread
view the rest of the comments
[-] sjohannes@programming.dev 5 points 2 months ago

Is this homework of some sort?

By default, GNU ls will quote entries containing certain special or unprintable characters. For example, if a file name contains the space character, GNU ls will print e.g. 'hello world'. This quoting is done using Bash syntax.

In Bash, 'folder'$'\003' (or $'folder\003') represents the text folder followed by octal byte 3. Because you use Fish instead of Bash, this doesn't work­—it has a different syntax to specify unprintable/special characters.

I can tell you how to refer to this file in Fish, but I hesitate to do it if it's for homework. What I will do is point you to the part of the Fish documentation where this is (kind of) explained: in Fish for bash users#Quoting.

[-] Successful_Try543@feddit.org 4 points 2 months ago* (last edited 2 months ago)

Would it help to use ls --literal --show-control-chars to find out if \003 is indeed the representation of a special character?

[-] sjohannes@programming.dev 4 points 2 months ago* (last edited 2 months ago)

The default output itself is pretty definitive, assuming you are indeed using GNU ls and don't have the QUOTING_STYLE environment variable set. https://www.gnu.org/software/coreutils/manual/html_node/Formatting-the-file-names.html explains all this (including your options) and more.

$ touch $'folder\x03'
$ ls --quoting-style shell-escape  # the default
'folder'$'\003'
$ ls --quoting-style c
"folder\003"
$ ls --quoting-style escape
folder\003
[-] BradleyUffner@lemmy.world 2 points 1 month ago

I wouldn't expect homework to use fish. It seems a less useful and niche as a learning exercise.

this post was submitted on 18 Jun 2026
5 points (60.9% liked)

linux4noobs

4360 readers
1 users here now

linux4noobs


Noob Friendly, Expert Enabling

Whether you're a seasoned pro or the noobiest of noobs, you've found the right place for Linux support and information. With a dedication to supporting free and open source software, this community aims to ensure Linux fits your needs and works for you. From troubleshooting to tutorials, practical tips, news and more, all aspects of Linux are warmly welcomed. Join a community of like-minded enthusiasts and professionals driving Linux's ongoing evolution.


Seeking Support?

Community Rules

founded 3 years ago
MODERATORS