What are Linux POSIX options and GNU options?

Command line interface type

The command line interface is primarily designed according to the POSIX and GNU specifications.

This article cites a significant portion of the reference page description below. If you would like to see more details, please visit the reference site directly.

Reference: [Linux Command Option Customs (General Option List)](https://debimate.jp/2019/02/23/linux-command-option%E3%81%AE%E6%85%A3%E7 % BF% 92% E4% B8% 80% E8% 88% AC% E7% 9A% 84% E3% 81% AAoption% E4% B8% 80% E8% A6% A7 / # Command_Option% E3% 81% AB% E9% 96% A2% E3% 81% 99% E3% 82% 8BPOSIX% E8% A6% 8F% E6% A0% BC)

POSIX

POSIX 【 Portable Operating System Interface 】 POSIX is a standard that defines standards such as how to call from a program, mainly for functions common to UNIX-based OSs.

API specifications and standard library functions for using system calls that call kernel functions from C language are defined, and programs developed using only POSIX specifications are the same for any POSIX-compliant OS. Can be operated.

In addition to the API, standards are also set for the shell command system, process and thread specifications, file and directory configurations, system database formats such as password files, and archive file formats.

Reference: What is POSIX (Portable Operating System Interface) --IT Glossary e-Words

POSIX optional standards

--Options start with "-" and the option string is one alphanumeric character --When using multiple options, you can omit "-" and connect (example: "-a -b -c" can be written as "-abc") --Put a space between the option and the option argument --Options must exist before command line arguments --Options can be omitted when executing the command line

GNU

**GNU 【 GNU is Not Unix 】 ** GNU is a project to develop and publish a group of software related to UNIX-like OS using only free software (especially open source software). It was founded by Richard M. Stallman and is being promoted by the Free Software Foundation (FSF), which he represents.

The names of software provided as part of GNU often include "GNU" as part of it (GNU Emacs, etc.) or begin with "g" (gcc, glibc, etc.).

Reference: What is GNU-IT Glossary e-Words

GNU optional standard

In addition to recommending compliance with the POSIX standard, the following specifications have been added.

-“–” And optional long name support (eg “–version” corresponding to “-v”) --Support for concatenated options and optional arguments (eg –test = path) --Minimum support for "–version" (version display) and "–help" (help or Usage display)

List of common options

Short Option Long Option Function (Command that implements the option)
a all Processing for all files and all users (du, nm, uname)
b bytes、blocks Set the size of bytes and blocks (du, df)
c cmd Set Command and Option to pass to subprocess (bash, python)
d debug Output debug message (many Commands)
e exclude Set exclusion target (example: file)(rync)
f file Set the file to use (awk, make, sed, tar)
g group Set group (install)
h help Show help on using Command (many Commands)
i inodes Show inode information instead of block usage(ls、df)
Besides inodes, interactive also exists (rm, mv)
j jobs Set the number of jobs (make)
k keep Suppress deletion of files, messages, resources, etc. (passwd, bzip)
l list Show list of files, directories, etc. (unzip, ls)
m mode Permission settings (install, mkdir)
n number Display numbers (example: line numbers)(head、tail、grep)
o output Output file name and output file path settings (many Commands)
p a diversity of See references
q quiet Suppress message output (many Commands)
r recursive Perform processing recursively (grep, chgrp, choose, cp, ls, diff, rm)
s silent Suppress message output (many Commands)
t a diversity of See references
u update Perform update (apt, yum, cp, mv, tar)
v version Display program version information (many Commands)
w width Width setting (ls, ptx)
x extract Display a list of files extracted from archives (tar, zip)
y yes In the user confirmation process, it is considered that the user answered yes to all confirmation items (apt, yum).
z zip(compress) Enable compression (tar)

reference

[Linux Command Option Customs (General Option List)](https://debimate.jp/2019/02/23/linux-command-option%E3%81%AE%E6%85%A3%E7%BF % 92% E4% B8% 80% E8% 88% AC% E7% 9A% 84% E3% 81% AAoption% E4% B8% 80% E8% A6% A7 / # Command_Option% E3% 81% AB% E9% 96% A2% E3% 81% 99% E3% 82% 8BPOSIX% E8% A6% 8F% E6% A0% BC)

Command-Line Options

Option Table (GNU Coding Standards)

Recommended Posts

What are Linux POSIX options and GNU options?
What are environment variables? (Linux)
Are macOS and Linux completely different?
What are "sudo ln -s" and "ln -s"?
(Beginner) What are cores and threads?
What are the directories such as Linux, / etc and / var / log?
Training data and test data (What are X_train and y_train?) ①
Training data and test data (What are X_train and y_train?) ②
[Mathematics] Let's visualize what are eigenvalues and eigenvectors
What is POSIX?
What is Linux
What are you comparing with Python is and ==?
What is Linux
What are python tuples and * args after all?
What is Linux
What is the difference between Unix and Linux?
OS and Linux distribution
What are environment variables?
What is Linux for?
What is UNIT-V Linux?