Questions tagged [conventions]

Naming conventions and best practice

Filter by
Sorted by
Tagged with
0
votes
1answer
45 views

Can I add arbitrary directory to icon search dirs?

Linux desktop environments such as GNOME, KDE, XFCE etc search icon themes in some standard paths such as /usr/share/icons, ~/.icons, ~/.local/share/icons etc. I wonder if I can add any directory to ...
0
votes
1answer
40 views

why aliases found in root users ~/.bashrc file are not used for standard users by default?

Is there any reason why aliases like alias rm='rm -i' found in the ~/.bashrc file of user root are not used by default for any other users?
0
votes
1answer
131 views

Naming convention of worker threads

I started reading about worker threads. Old Legacy worker threads is replaced with worker pools. $ ps -ef | grep 'kworker' root 6 2 0 04:41 ? 00:00:00 [kworker/0:0H-kb] root ...
-2
votes
2answers
30 views

Debian packages naming, documentation is self-contradicting

Debian policy manual (released on 2019-10-03) clearly states that "Package names (both source and binary, see Package) must consist only of lower case letters (a-z), digits (0-9), plus (+) and minus (-...
-1
votes
2answers
56 views

Use of a specific character for commenting, like e.g. #, in config files depends on…? [closed]

I need help settling a discussion about comments in configuration files. This is about the question "what dictates which character/string is used for commenting in any given program?" Theory A) ...
25
votes
10answers
6k views

one-liner vs script

I've noticed a lot of questions and answers and comments expressing disdain for (and sometimes even fear of) writing scripts instead of one-liners. So, I'd like to know: When and why should I write a ...
1
vote
3answers
109 views

What are the conventional meanings for symbols used to show commands' syntax?

I am looking for some sort of "syntax key" for command line tools on GNU/Linux, something like this document that Microsoft has: https://docs.microsoft.com/en-us/windows-server/administration/windows-...
0
votes
1answer
374 views

Why doesn't CTRL + C exit vim? [duplicate]

I'm aware that if I press esc followed by typing :q!, I can exit the vim editor, due to this question. However, the standard convention is for programs to exit when ctrl + c is pressed, which sends a ...
2
votes
1answer
67 views

How to differentiate an executable sh file, and a source sh file?

I have sh files that are executable, and others that are only meant to be sourced by executable ones. On the executable ones I use no extension at all, and have the first line as #! /bin/sh. On the ...
3
votes
1answer
185 views

When did user accounts using UIDs above 1000 become normal? And why?

We have a really old NIS domain which is mapping some user accounts to UIDs less than 1000. I'm wondering when did using UIDs greater than or equal to 1000 for human users become 'standard', why did ...
-1
votes
3answers
172 views

Why is it uncommon for stdin inputs to have option-like inputs, while common for command line arguments?

POSIX and GNU have their syntax styles for options. For all the commands that I have seen, they accept option-like inputs as command line arguments. Is it uncommon for a program to accept option-...
2
votes
3answers
505 views

Will it be bad that a function or script name contains dash `-` instead of underline `_`?

If I name a function or script with dash - instead of underline _ between words, would that be bad? For example, function duplicate-me() or duplicate-me.sh. In bash, a variable name can contains ...
3
votes
1answer
114 views

GRUB Partion Naming Conventions

In the GNU GRUB info pages in the Ubuntu 16.04 LTS distro, the naming convention for partitions seemed straight forward with the following definition: (hd0,msdos2)   Here, 'hd' means ...
0
votes
1answer
372 views

What is the numbering convention in .conf files(inside a conf.d)?

Inside the xorg.conf.d/ for example, we have three files: 00-keyboard.conf 10-monitor.conf 30-touchpad.conf I know that the 2-digit number determine the precedence that each file is read so 00-...
2
votes
1answer
672 views

What do you call the calling convention behind `int 0x80`?

I know there is a syscall convention but what do you call the calling convention that precedes it that you see when you call to int 80 rather than syscall, like this. mov rax,4 ; system call ...
3
votes
1answer
2k views

FreeBSD vs Linux: performance of kernel calling conventions

From int80h.org, the FreeBSD Assembly Language Tutorial [The Linux Calling] convention has a great disadvantage over the Unix way, at least as far as assembly language programming is concerned: ...
1
vote
1answer
137 views

awk : best practice for loop variable naming [closed]

The following code results in an infinite loop because awk doesn't support local variable in { … } scope. #! /usr/bin/gawk -f function myfunction() { for (i = 5; i < 8; i++){ print "...
2
votes
1answer
99 views

What is the usual single letter flag denoting an IP address in a commandline option? [closed]

I noticed in most programs that I use that read in IP addresses, they either use no option flag to denote IP address and it is just part of the default input (like ssh, scp, ifconfig, etc...) or it is ...
9
votes
2answers
1k views

When to use standard error stream in command-line application?

Is there a guideline when to use the error when writing a command-line application? To my surprise, I didn't find anything when googling it. In particular, the question I'm concerned with right now ...
13
votes
2answers
2k views

An official standard / convention for a file extension for shell scripts to source

I was wondering if there is a convention for file type extensions for shell scripts you want to source instead of run. For example: If I want to run this script in a subshell. ./script.sh If I ...
1
vote
2answers
181 views

Mount point for system-wide USB disk

I have a USB disk connected to a server computer which is mounted when the computer starts. I'm thinking that it's not ideal to mount it under the /media directory since it could potentially lead to a ...
61
votes
8answers
10k views

Why does Bash's source not need the execution bit?

With Bash's source it is possible to execute a script without an execution bit set. This is documented and expected behaviour, but isn't this against the use of an execution bit? I know, that source ...
2
votes
0answers
27 views

epstopdf loose greek symbole

I'm generating a pdf using gnuplot this way: set term postscript color eps enhanced 15 set out '| epstopdf --filter --outfile=SD.pdf' replot set out Whereas the eps file generated contains the ...
3
votes
1answer
140 views

How to determine program success when running a sequence of similar tasks?

I am writing a series of CLI tools that share the same parent command, similar to programs like git. program verb OPTIONS One of the action verbs, install, is designed to git clone as many ...
5
votes
2answers
1k views

How are log files named?

Or what can we infer from the names of log files? For example, when I want to check the Xorg logs, I find three files: Xorg.0.log Xorg.0.log.old Xorg.1.log You can also find many such log ...
10
votes
2answers
3k views

Convention/standard on using curly braces around options

The man page for tar in Arch Linux SYNOPSIS section starts with: tar {A|c|d|r|t|u|x}[GnSkUWOmpsMBiajJzZhPlRvwo] [ARG...] I perfectly understand that in this situation it means that exactly one of ...
5
votes
1answer
320 views

Why do some utilities parse operands before options?

According to several sources, the UNIX utility guidelines specify that operands should always be processed after options: utility_name[OPTIONS][operands...] Some older UNIX utilities are known to ...
3
votes
4answers
6k views

What is “fs” short for in kernel function “get_fs()”?

There are two Linux kernel functions: get_ds() and get_fs() According to this article, I know ds is short for data segment. However, I cannot guess what "fs" is short for. Any explanations?
17
votes
1answer
3k views

What is the number prefix in config files from .d directory

A lot of unix config files in xx.d folders are prefixed by a number, like : $ ls /etc/grub.d/ 00_header 10_linux 30_os-prober 40_custom 05_debian_theme 20_linux_xen 30_uefi-...
0
votes
1answer
766 views

How are the different kernel naming schemes relate?

I am running Ubuntu 13.10 with the Kernel 3.8.0-030800-generic downloaded from http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.8-raring/ When I want to run for example turbostat or cpupower commands,...
6
votes
1answer
2k views

When should you use subshells vs `xargs`?

Many simple commands using xargs could be rewritten as commands using subshells. For instance, here is something I was using earlier today, to concatenate the ten largest binaries in /usr/bin, written ...
0
votes
1answer
129 views

KSH conventions scripting [closed]

I'm writing scripts in ksh atm. I'd like to know if there is any "conventions" as for example, always doing "unset" before using a variable, or using typeset to define a new variable, etc.
4
votes
1answer
594 views

Linux Icon Naming Conventions

Is there a naming convention in Linux when it comes to application icon filenames? What I'm referring to is the practice of including the icon size in the filename if the application uses multiple ...
8
votes
2answers
5k views

Where should I mount my external harddrive?

I've got an external harddrive that I'd like to auto-mount. It will be present most times when my laptop boots. Where is the "correct" place to mount it? /media/my-hd: Will litter /media with an ...
60
votes
2answers
17k views

Why are shared libraries executable?

Why have almost all the shared libraries in /usr/lib/ have the executable permission bit set? I don't see any use case for executing them. Some do manage to hook-up some form of main function to print ...
49
votes
7answers
105k views

File extensions for unix shell scripts [closed]

On wikipedia, the article for .sh says: For the .sh file extension type, see Bourne shell. How about other unix shells? I know that the shebang is used inside the file to indicate an ...
19
votes
2answers
7k views

Origin of the word cron?

Trying to settle a friendly argument. Is "cron" an acronym for something? Additionally, did it's current canonical name "cron" originate from something shortened for something like chronos or ...
7
votes
2answers
937 views

What's the origin of rc, rc.d, share, proc in Linux?

I still can't figure out many abbreviations' origin like rc, rc.d, share, proc... I've heard someone says rc is "run command", .d is directory, but I'm not sure that's true. Is there a table ...
8
votes
3answers
11k views

Directories with binary files in Linux

I noticed that when I install new application there are a few possible directories where the resulting binary file will be placed. You can install with packaging manager, compile with make, ...
6
votes
3answers
14k views

Most common encoding for strings in C++ in Linux (and Unix?)

For creating a C++ program that is source code level portable between Windows and Linux and handles internationalization well, there are IMHO three main encodings to consider: The encoding of the C++ ...
22
votes
3answers
21k views

File and directory naming conventions

I want to refactor the files and directories on my system. However I am not sure what is best practice. After reading this question and its answers I assume the most important part is to be ...
6
votes
3answers
2k views

Best directory for shared scripts

What is the conventional directory to keep shared scripts that might be used by more than one user? I've read through this overview of the standard file system hierarchy, but it doesn't seem to ...
6
votes
2answers
11k views

Numbering convention for the linux kernel?

What is the convention for numbering the linux kernels? AFAIK, the numbers never seem to decrease. However, i think I've seen three kinds of schemes 2.6.32-29 2.6.32-29.58 2.6.11.10 Can anybody ...
188
votes
4answers
100k views

Why do we use su - and not just su?

I don't understand why su - is preferred over su to login as root.
55
votes
17answers
14k views

Why do Unix-heads say “minus”? [closed]

A couple of weeks ago I attended a talk on Git by someone who seemed to be from a Windows background. I say "seemed to be" because he kept saying "dash" when referring to command-line options. I ...
10
votes
2answers
1k views

Anyone know the meaning of yy?

Since history questions are considered on topic, I figured I'd ask one that's been bugging me for quite some time and no one I know seems to know the answer. Does anyone know what the historical ...