Linked Questions

1
vote
1answer
56 views

What is “C sort order” in pm-action manpage? [duplicate]

From manpage pm-action(8): /etc/pm/sleep.d, /usr/lib/pm-utils/sleep.d Programs in these directories (called hooks) are combined and executed in C sort order before suspend and hibernate ...
85
votes
6answers
163k views

Convert file contents to lower case

I have temp file with some lower-case and upper-case contents. Input Contents of my temp file: hi Jigar GANDHI jiga I want to convert all upper to lower. Command I tried the following command: ...
25
votes
3answers
4k views

Why does sort say that ɛ = e?

ɛ ("Latin epsilon") is a letter used in certain African languages, usually to represent the vowel sound in English "bed". In Unicode it's encoded as U+025B, very distinct from everyday e. However, if ...
13
votes
3answers
4k views

Why does [a-z] asterisk match numbers?

I have 3 directories at current path. $ls a_0db_data a_clean_0db_data a_clean_data $ls a_*_data a_0db_data: a_clean_0db_data: a_clean_data: $ls a_[a-z]*_data a_clean_0db_data: a_clean_data: I ...
14
votes
1answer
12k views

Find a file where name starts with a capital letter

I'm trying to find all files for which there name starts with a capital letter. I have tried using the following command: find . -type f -regex '.*\/[A-Z][^/]*' It's finding paths with only ...
1
vote
7answers
6k views

Matching n letter filename with ls

I am using the ls command in bash, trying to find all files or directory of length n. Let's say n=5 My command is: ls ????? But this would also include characters that are non letters such as ...
20
votes
2answers
792 views

Bracket expression (without ranges) matching unexpected character in bash

I'm using bash on Linux. I am getting a success from the following if statement, but shouldn't this return a fail code? if [[ ■ = [⅕⅖⅗] ]] ; then echo yes ; fi The square does NOT equal any of the ...
13
votes
3answers
10k views

How to have console messages in English?

I am French and use my Debian system in French. However, I would like to have error messages in terminal in English. It allows me to post them on English speaking websites. How can I change my ...
9
votes
4answers
33k views

Matching string with a fixed number of characters using grep

I am trying to find all 6 letter words using grep. I currently have this: grep "^.\{6\}$" myfile.txt However, I am finding that I am also getting results such as: étuis, étude. I suspect it has ...
7
votes
5answers
2k views

List out strings which are substrings of other strings in the list

I have a list of names like so: dog_bone dog_collar dragon cool_dragon lion lion_trainer dog I need to extract out names that appear in other names like so: dragon lion dog I looked through the ...
5
votes
2answers
12k views

Print lines if given column starts with a capital letter

I have a file like this: ID A56 DS /A56 DS AGE 56 And I'd like to print the whole line only if the second column starts with a capital letter. Expected output: ID A56 DS AGE 56 What I've ...
6
votes
5answers
1k views

How to delete all directories in a directory older than 2 weeks except the latest one that match a file pattern?

I have the following path: /dir1/dir2/ In this path I have the following directories containing various (not relevant) application detrius: follower1234 1-Dec-2018 follower3456 2-Dec-2018 ...
11
votes
2answers
2k views

Having a problem with a shell script counting characters

I'm trying to learn the basics and I have run into an issue with my script counting the characters of a user's input. Here is my script, can someone point out where I'm going wrong please? #!/bin/...
8
votes
2answers
18k views

Replace non-printable characters in perl and sed

I need to replace some non-printable characters with spaces in file. Specifically, all characters from 0x00 up to 0x1F, except 0x09 (TAB), 0x0A (new line), 0x0D (CR) Up until now, I just needed to ...
4
votes
1answer
14k views

Unix sort by multiple columns

I have trouble understanding unix sort. Consider the following file (tab separated) aa ~ a1 aa B b A b ~ e bb B bb ~ B When calling: cat tmp2 | sort -t $'\t' -k1,2 I get aa ~ a1 aa B b ...

15 30 50 per page