Linked Questions

5
votes
2answers
2k views

bash: Replace single quote by two quotes in string

I have a variable, e.g. a'b, containing a single quote which I need to replace by two single quotes before writing it to a file: a''b. The following bash code used to get the job done for me ... ...
2
votes
2answers
2k views

Quoted filenames with spaces in ls output on OSX

The problem I don't want to see filenames quoted when they contain spaces. Example On OSX I see this when running ls: > ls -l total 0 drwxr-xr-x 2 mafro staff 68 Mar 16 09:02 'dir with spaces' ...
0
votes
2answers
52 views

Line editor ed saves some filenames in single quotes followed by one space

I'm following The Unix Programming Environment exercises and have encountered some weird issues. While going through the ed exercise, when you just start ed, type in the exercise, then do w poem It ...
0
votes
2answers
101 views

Why `ls [0-9]` finds a file called `[0-9]`, and worse, not after `touch 1`?

$ mkdir temp && cd temp $ ls [0-9] ls: cannot access '[0-9]': No such file or directory $ touch \[0-9\] $ ls [0-9] '[0-9]' $ touch 1 $ ls 1 '[0-9]' $ ls [0-9] 1 I find this behavior very ...
4
votes
1answer
341 views

Why does `ls` add a leading whitespace to its output for certain directories?

If I use the ls command in my home directory each line of output has a leading whitespace: $ ls bin Documents ... It only seems to do this for my home directory. Why does it do this? Note: I ...
3
votes
1answer
63 views

Is it possible to make a directory literally called “..”

(Not that you would ever want to), is it possible to create a directory with the literal name .. or .? Under most filesystems it is a reserved name, but would it be possible on, say, XFS, JFS, or some ...
2
votes
1answer
280 views

Why is my directory getting quotes around it when created? [duplicate]

I create a directory called bob@example.com/ I wanted to use this email address as the directory name - I know - not a good idea for many reasons - but lets assume this is a very temporary ...
2
votes
1answer
175 views

“ls -b” does not work on macOS

ls -b should print the file names with non-printable characters, for example, ex ex.txt should be shown as ex\ ex.txt, but this does not work on macOS, it is still ex ex.txt. Does anyone know the ...
0
votes
1answer
45 views

List directories starting with '

I have a lot of folders in a directory and some are starting with the character '. I would like to remove these. Example folders Folder.A 'Folder.B' <-- want to delete this 'Folder.C' <-- want ...
0
votes
1answer
896 views

Can't remove apostrophes from filenames in terminal [duplicate]

I don't understand why zsh and bash (ls) show me lots of filename inside apostrophes, but not all: 'joe rilla - mauern fallen.mp3' jokaz-alarmbereit.mp3 'yoshi blessed - everybody free.mp3' I tried ...
3
votes
0answers
65 views

I can see but cannot delete a file [closed]

I am running Linux Mint.I tried to copy a file with the file manager. It looked like it hung. I can see the file in the directory with ls -l: -rwxr-xr-x 1 mike domain^users 20 Mar 1 08:57 'output (...
1
vote
0answers
606 views

How to remove a single quote from a file name? [duplicate]

I have some podcasts on my radio server which contain a timestamp when they should be played. I noticed one of them is put into single quotes 'filename.mp3', and I'm unable to remove them. Check this: ...
1
vote
0answers
44 views

Unexpected single-quotes in file name [duplicate]

Original post over here: https://stackoverflow.com/questions/35350216/unexpected-single-quote-in-file-name Basically, it seems that ever since I accidentally overloaded my filesystem (it's not ...
0
votes
0answers
24 views

Using bash wildcards with filenames that have single-quotes [duplicate]

I used wget within bash to download a bunch of files from a parameterized URL. My URL file looked something like this: http://www.example.com/Home/Sales?lrsn=48726 http://www.example.com/Home/Sales?...
0
votes
0answers
37 views

Recursively removing all backslashes in directory and file names with find and rename

I want to extend a recent question which I have asked to remove french characters with a combination of find and rename: Rename files and directories with French characters Now I am facing some ...

15 30 50 per page