Skip to main content

Questions tagged [conventions]

Naming conventions and best practice

0 votes
1 answer
117 views

Should my cat utility support multiple keys simultaneously?

So, i was given a task to implement simple version of cat utility. It should support some of GNU keys, for given text returns the same results as real cat utility and i was given this synopsis: cat [...
Mark's user avatar
  • 99
3 votes
1 answer
1k views

Use underscore or hyphen for a CLI utility name? [closed]

I'm creating a CLI utility which is aimed at *nix OS:es. Let's call it 'Super CLI Project'. Looking at the latest POSIX Issue 7, 2018 edition - https://pubs.opengroup.org/onlinepubs/9699919799/ - ...
Beamie's user avatar
  • 133
0 votes
2 answers
2k views

Setting Application Defaults in Linux /etc/default

Am I being a curmudgeon, or should /etc/default be reserved to settings for the operating system? I'm seeing systems show up with /etc/default/{company}-environment. The file is typically Tomcat data, ...
Chris K's user avatar
  • 60
2 votes
1 answer
385 views

Dot file and an adjacent identically named file without dot?

Is it bad practice to have a dot file and an adjacent identically named file without dot? Background: We already create a $HOME/.ourapp directory where we store various configuration files, log files,...
Adám's user avatar
  • 221
0 votes
0 answers
234 views

Linux so convention: is the .so link intended to come from dev packages?

On my Ubuntu jammy Linux PC, after installing the libuv1 package (apt-get install libuv1), I noticed that there was a file, named libuv.so.1.0.0 and a symbolic link to it, named libuv.so.1: $ find /...
StoneThrow's user avatar
  • 1,957
2 votes
4 answers
355 views

Function's comment is not printed out when putting it before the function's header

A good and well-established guideline for commenting a shell function is to put it before the function's header. I am trying to follow these guidelines as much as I can, but this convention makes it ...
Rubem Pacelli's user avatar
0 votes
0 answers
74 views

Is there a character convention for representing stderr?

By convention, stdout is -. Is there something similar for stderr?
midrare's user avatar
  • 153
0 votes
1 answer
277 views

Conventions for the PATH variable's value

I am looking for best practices, or at least conventions, for the PATH variable's value. In particular, I would like to know is there any preferred/recommended ordering for the /bin, /usr/bin, and /...
kjo's user avatar
  • 16.4k
0 votes
1 answer
109 views

best practices for adding my own tools and configuration

So, I am currently writing some scripts to gather and bulk report break-in attempts on my server. The scripts itself are working, but I am wondering where I should put my config files and the script ...
siryx's user avatar
  • 95
1 vote
1 answer
3k views

What's the difference between device properties and device attributes in udev?

For udev device entries, what is the technical difference between a "property" and an "attribute"? How are they customarily created (generated?) and used? Which one is the better ...
Bergi's user avatar
  • 117
0 votes
0 answers
50 views

Why Linux uses `blah' to quote strings by convention? [duplicate]

While I was reading the document of some Linux utilities, I found that they always quote strings using ` and '. For example, below is an excerpt from the man page of the find utility. -exec ...
Fajela Tajkiya's user avatar
2 votes
3 answers
1k views

Display a message in color by a conventional color name such as Red, Green, Blue, etc

WSL with Ubuntu 18.04 and GNU bash, version 4.4.20(1)-release (x86_64-pc). I wish to display a message with a conventionally named color via argument such as -red, or -green, or -blue or anything like ...
Lahor's user avatar
  • 123
1 vote
2 answers
2k views

Where should I source /usr/local/etc/profile from? .bash_profile or /etc/profile?

I know that, by default, bash will source /etc/profile and ~/.bash_profile. Now, suppose I also have machine-specific profile commands in /usr/local/etc/profile (involving stuff that's in /usr/local, ...
einpoklum's user avatar
  • 11k
2 votes
1 answer
51 views

Is it good practice to add the manpage section number to POSIX tools when referring to them? [closed]

I sometimes see people referring to tools, like ls append the manpage section number in parens, like the manpages themselves do (in ls's case ls(1)) in prose/text like answers and comments here on ...
Andreas's user avatar
  • 21
0 votes
2 answers
269 views

How to sort filename list (txt-file) by sub-strings of the filename/path with multiple levels. Special challenge: Two types of filename conventions

I'd like to sort the following list of filenames / pathes. L1_Data/level1/192027/LC08_L1TP_192027_20201126_20210316_01_T1 DONE L1_Data/level1/192028/LC08_L1TP_192028_20201126_20210316_01_T1 DONE ...
jaysigg's user avatar
  • 111

15 30 50 per page
1
2 3 4 5