Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

57 votes
5 answers
8607 views
Is there a tool/website to compare package status in different Linux distributions?
I am currently looking for a website or a tool that would allow me to compare the package state of a particular software in different Linux distributions. For instance, which version of gimp is provided by Mint, Ubuntu, Debian Sid and Fedora 18? An immediate interest would be to be able to avoid rei...
I am currently looking for a website or a tool that would allow me to compare the package state of a particular software in different Linux distributions. For instance, which version of gimp is provided by Mint, Ubuntu, Debian Sid and Fedora 18? An immediate interest would be to be able to avoid reinventing the wheel when packaging software (for instance re-use patches from other distros).
Thomas Moulard (810 rep)
Jan 24, 2013, 04:04 AM • Last activity: Jul 23, 2024, 10:00 AM
1 votes
1 answers
266 views
Best updated alternative to Linux in a Nutshell?
I'm old and forgetful. I've been using my handy-dandy copy of *Unix in a Nutshell* for years to look up syntax and such. I decided it's time to update it (it's nearly 30 years old at this point) and switch to a Linux version. However, it appears that O'Reilly has transitioned to a mostly online, ski...
I'm old and forgetful. I've been using my handy-dandy copy of *Unix in a Nutshell* for years to look up syntax and such. I decided it's time to update it (it's nearly 30 years old at this point) and switch to a Linux version. However, it appears that O'Reilly has transitioned to a mostly online, skillshare-type company and hasn't updated *Linux in a Nutshell* in more than a decade. In addition, it now covers stuff like "virtualization, wireless network management, and revision control with git", none of which I'm interested in a command reference. So before I shell out $30-65 for an outdated reference filled with stuff I don't need, are there any better alternatives? I'm looking for a physical book (because I'm old) rather than a PDF or other online reference. I'd like something that lists commands with the syntax, options, and maybe a couple of short examples. The version I have has useful chapters on sed, awk, test, and pattern matching (regex), so that would be good too. I'll probably pick up a used copy to start with but if there's something more recent or better, I'd love to hear about it.
Roger Sinasohn (119 rep)
Dec 5, 2022, 08:06 PM • Last activity: Feb 2, 2023, 06:15 AM
4 votes
1 answers
9130 views
Argon2 Commands in the Terminal
I have been using Argon2 in my terminal (Debian), but I keep messing up, and I have been unable to find the manual or any other documentation that lists examples of commands that work. Could someone give me a basic rundown of what the most important commands are? Or point me to a good reference? I h...
I have been using Argon2 in my terminal (Debian), but I keep messing up, and I have been unable to find the manual or any other documentation that lists examples of commands that work. Could someone give me a basic rundown of what the most important commands are? Or point me to a good reference? I have the usage right in front of me, but that does not help me much. Usage: argon2 [-h] salt [-i|-d|-id] [-t iterations] [-m log2(memory in KiB) | -k memory in KiB] [-p parallelism] [-l hash length] [-e|-r] [-v (10|13)] Password is read from stdin Parameters: salt The salt to use, at least 8 characters -i Use Argon2i (this is the default) -d Use Argon2d instead of Argon2i -id Use Argon2id instead of Argon2i -t N Sets the number of iterations to N (default = 3) -m N Sets the memory usage of 2^N KiB (default 12) -k N Sets the memory usage of N KiB (default 4096) -p N Sets parallelism to N threads (default 1) -l N Sets hash output length to N bytes (default 32) -e Output only encoded hash -r Output only the raw bytes of the hash -v (10|13) Argon2 version (defaults to the most recent version, currently 13) -h Print argon2 usage
Patriot (143 rep)
Mar 24, 2020, 04:33 PM • Last activity: Feb 1, 2023, 04:27 PM
52 votes
5 answers
58115 views
/etc/hosts file refer to another configuration file
How can I get the `/etc/hosts` file to refer to another configuration file for it's list of hosts? Example `/etc/hosts`: ## My Hosts 127.0.0.1 localhost 255.255.255.255 broadcasthost #Other Configurations #Other Addresses 3.3.3.3 MyAwesomeDomain.com 4.4.4.4 SomeplaceIWantToGoTo.com ConfigFile.txt ##...
How can I get the /etc/hosts file to refer to another configuration file for it's list of hosts? Example /etc/hosts: ## My Hosts 127.0.0.1 localhost 255.255.255.255 broadcasthost #Other Configurations #Other Addresses 3.3.3.3 MyAwesomeDomain.com 4.4.4.4 SomeplaceIWantToGoTo.com ConfigFile.txt ##My additional Hosts 1.1.1.1 SomeLocation.com 2.2.2.2 AnotherLocation.com How do I add a link/Reference to /etc/hosts file such that ConfigFile.txt will be loaded?
DogEatDog (695 rep)
Jan 7, 2013, 04:11 PM • Last activity: Jan 21, 2023, 12:33 PM
16 votes
3 answers
4976 views
Is there any documentation for udev builtins?
The man page for udev mentions in several places that certain rules options can be used to invoke 'builtin' commands, which are apparently built in to the udev program itself. However, I haven't been able to find any reference documentation that clearly explains what udev builtins are available; wha...
The man page for udev mentions in several places that certain rules options can be used to invoke 'builtin' commands, which are apparently built in to the udev program itself. However, I haven't been able to find any reference documentation that clearly explains what udev builtins are available; what they do and how they are used. I have searched the web without much success. Does anyone know if there is a reference anywhere that provides details about these builtin commands?
Time4Tea (2628 rep)
Jan 10, 2019, 05:38 PM • Last activity: Jan 2, 2023, 06:44 PM
75 votes
6 answers
6336 views
Resources for portable shell programming
What resources exist for portable shell programming? The ultimate answer is to test on all targeted platforms, but that's rarely practical. The [POSIX / Single UNIX specification](http://pubs.opengroup.org/onlinepubs/009695399/) is a start, but it tells neither you what the level of support of each...
What resources exist for portable shell programming? The ultimate answer is to test on all targeted platforms, but that's rarely practical. The [POSIX / Single UNIX specification](http://pubs.opengroup.org/onlinepubs/009695399/) is a start, but it tells neither you what the level of support of each implementation is, nor what common extensions exist. You can read the documentation of each implementation, but that's very time consuming and not completely accurate. I seems to me that an ideal format would be some kind of community-annotated version of the POSIX spec, where each feature is annotated by its support level amongst the different implementations. Is there such a thing? Or are there other useful resources? For example, there is [Sven Mascheck's shell portability pages](http://www.in-ulm.de/~mascheck/various/) , but it's only about syntactic elements and a few built-ins, and only covers old shells. I'm looking for a more comprehensive resource.
Gilles 'SO- stop being evil' (862327 rep)
Mar 23, 2011, 09:56 PM • Last activity: Apr 24, 2022, 06:56 AM
9 votes
1 answers
1252 views
Who decided the bc math library will define sine cosine and arctangent?
If you load the [bc math library](https://www.gnu.org/software/bc/manual/html_node/bc_18.html) you get the trig functions `s()` and `c()` and `a()` which are sine, cosine, and arctangent respectively. Why these three functions? I know why it's those three from the mathematical perspective: it's beca...
If you load the [bc math library](https://www.gnu.org/software/bc/manual/html_node/bc_18.html) you get the trig functions s() and c() and a() which are sine, cosine, and arctangent respectively. Why these three functions? I know why it's those three from the mathematical perspective: it's because those are the three you need to translate directly between Cartesian and polar coordinates. I'm a math teacher, and this is unfortunately the only place I've seen sine/cosine/arctangent established as the set of *primitive* trigonometric functions, so I was hoping someone could tell me *why* in a more historical context. Idk I mostly need ammo when talking with math educators about why it's not a blasphemous idea to introduce arctangent to students before tangent.
Mike Pierce (952 rep)
Jun 2, 2021, 04:42 PM • Last activity: Jun 6, 2021, 01:12 AM
4 votes
4 answers
7723 views
retrieve bash array by referencing its name as a variable
I need help with bash expansion. I want to retrieve array values, GNU bash 5.1.0. The array name shall be a variable. "Just" referencing a variable in bash. I have an array named "armin" and its name is in variable $gral (works fine): gral="armin" Values are assigned: ``` declare -a ${gral}[1]="milk...
I need help with bash expansion.
I want to retrieve array values, GNU bash 5.1.0. The array name shall be a variable. "Just" referencing a variable in bash. I have an array named "armin" and its name is in variable $gral (works fine): gral="armin" Values are assigned:
declare -a ${gral}="milk"
declare -a ${gral}="cow"
declare  ${gral}="budgie"
declare  ${gral}="pla9ne"
fine. Array exists:
$ echo ${armin[@]}
milk cow budgie pla9ne
Array index exists:
$echo ${!armin[@]}
1 2 7 9
Array and index are fine. I want to retrieve the array by referencing its **name as a variable**, not manually. Have plenty of them ... The variable was set and used before:
$ echo $gral
armin  ## name of our bash array
fine - so far. Just to show the difference NOT using a variable:
echo ${armin[@]}
milk cow budgie pla9ne
Now attempts to reference a variable (gral) to call the name (armin):
$ echo ${$gral[@]}
-bash: ${$gral[@]}: wrong substitution.

$echo ${"$gral"[@]}
-bash: ${"$gral"[@]}: wrong substitution.
echo ${"gral"[@]}
-bash: ${"gral"[@]}: wrong substitution.
echo ${${gral}[@]}
-bash: ${${gral}[@]}: wrong substitution.
all fail. Some attempts with "eval" as well. Using associative (declare -A) makes no difference. Rem.: Index works fine this way, no issue. Name is the issue. I think I am missing something. Maybe the answer was described before, I found a lot of interesting stuff about variables in arrays but did not recognize an answer to my challenge. Can you **please help me find the term to retrieve the array by referencing its name as a variable**?
opinion_no9 (261 rep)
Mar 11, 2021, 03:13 PM • Last activity: Mar 13, 2021, 09:17 AM
1 votes
0 answers
264 views
Setting a user quota in ZFS which does not count snapshots
I love ZFS on Linux (RedHat 7), and users love the recovery that snapshots provide. The one problem that I have is that users will completely fill up their user quota then delete files expecting to immediately use up the free space. This does not work when using userquota, as snapshots count in user...
I love ZFS on Linux (RedHat 7), and users love the recovery that snapshots provide. The one problem that I have is that users will completely fill up their user quota then delete files expecting to immediately use up the free space. This does not work when using userquota, as snapshots count in userquota. reference quota would seem to be the solution, but I cannot see how to set a reference quota for a single user. The only solution would seem to be setting each user up with their own volume, but with hundreds of users, that is not practical.. I've checked the man pages, and google, and cannot find an example of this. Is this possible? Can someone provide an example for a user in the home directory.
jj76 (11 rep)
Dec 30, 2020, 05:02 PM
2 votes
2 answers
397 views
Is a NEWLINE character at line end required by LSB (Linux Standard Base)?
Both POSIX and SUS (Single UNIX Specification) define a line as > A sequence of zero or more non-` ` characters plus a terminating ` ` character. Many distributions are more oriented towards LSB than POSIX. LSB includes a lot of POSIX/SUS standards but not all exactly. Must lines also be terminated...
Both POSIX and SUS (Single UNIX Specification) define a line as > A sequence of zero or more non-` characters plus a terminating ` character. Many distributions are more oriented towards LSB than POSIX. LSB includes a lot of POSIX/SUS standards but not all exactly. Must lines also be terminated with a NEWLINE character in regards to LSB v4.1 ?
Mario Nette (61 rep)
Jun 14, 2020, 02:25 AM • Last activity: Jun 14, 2020, 05:34 PM
1 votes
2 answers
691 views
How linux communicate with hardware around the processor?
My question is more related to Unix/Linux development rather than administration itself. I think its directed for Unix/Linux low level system programmers rather than administrators. It will help me start kernel development and/or understanding Linux system development What information specifically a...
My question is more related to Unix/Linux development rather than administration itself. I think its directed for Unix/Linux low level system programmers rather than administrators. It will help me start kernel development and/or understanding Linux system development What information specifically about the hardware do I need to start learning about how Linux interacts with hardware peripherals and modules. For example, the bus architecture and how to communicate with controllers. Also, I'd like to mention that in most environments now the virtual machine is what Linux runs on. So, what is seen by the OS below it that's what I meant. I need some references, please, or how to start learning about that. I know basic x86 instructions but my questions is more about the memory and buses controllers around the processor itself; the programmer model I mean in the modern parallel programming environment.
AbdAllah Talaat (197 rep)
Mar 12, 2020, 05:33 PM • Last activity: Mar 13, 2020, 10:43 PM
0 votes
2 answers
791 views
What do letters for symlink options (-P -L -H) stand for?
I've summarized a list of commands that accepts symbolic link options according to SUSv4-2018ed: `cd chgrp chown chmod cp find ln ls pax rm` The full list also includes their defaults and other related options supported (such as `-h` and `-d`), and I stored it on my HDD for reference. I've previousl...
I've summarized a list of commands that accepts symbolic link options according to SUSv4-2018ed: cd chgrp chown chmod cp find ln ls pax rm The full list also includes their defaults and other related options supported (such as -h and -d), and I stored it on my HDD for reference. I've previously seen (GNU documents if I was correct) referring to -P -L options as "physical" and "logical" respectively, and I think that's probably where the option letters come from, but the latest docs as of Nov 2019 refer to them as "--no-dereference" and "--dereference" now. My question is: where do -P -L -H come from? Is it SUS, XPG, POSIX, SVID, or vendor documentation? And what do they initially stand for?
DannyNiu (692 rep)
Nov 21, 2019, 06:59 AM • Last activity: Nov 22, 2019, 09:56 AM
2 votes
2 answers
355 views
I am having difficulties with back-reference in awk
Recently, I am into security logs and want to make it better way on bash-shell. I found out in awk back-references are only stored by 9. But I need to use 10 back-references. Tried ```` awk '{print gensub(/^([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}).+?\sID\s(\[[0-9]{4}\]).+?\sTargetUser...
Recently, I am into security logs and want to make it better way on bash-shell. I found out in awk back-references are only stored by 9. But I need to use 10 back-references. Tried
`
awk '{print gensub(/^([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}).+?\sID\s(\[[0-9]{4}\]).+?\sTargetUserName\s=\s(.+?)\sTargetDomainName\s=\s(.+?)\sTargetLogonId\s=\s(.+?)\sLogonType\s=\s([0-9]{1,2})\s(.+?\sWorkstationName\s=\s(.+?)\sLogonGuid\s=\s.+?TransmittedServices\s=\s.+?\sLmPackageName\s=\s.+?KeyLength\s=\s.+?\sProcessId\s=\s.+?\sProcessName\s=\s.+?\sIpAddress\s=\s(.+?)\sIpPort\s\=\s([0-9]{1,}))?.+?$/,"\\5,\\4,\\3,\\2\\6,\\1,\\8,\\9,","g") }'
` Target strings (actually there are thousands of strings)
`
2017-03-21T02:00:00 kornawesome Security/Microsoft-Windows-Security-Auditing ID  :EventData/Data -> SubjectUserSid = S-1-5-18 SubjectUserName = PRETENDERS$ SubjectDomainName = WORKGROUP SubjectLogonId = 0x00000000000004j7 TargetUserSid = X-12-54-181 TargetUserName = SYSTEMS TargetDomainName = NT AUTHORITY TargetLogonId = 0x00000000000003e7 LogonType = 8 LogonProcessName = Lxxoi   AuthenticationPackageName = Negotiate WorkstationName = - LogonGuid = {00344000-0000-0000-0000-0000000003440} TransmittedServices = - LmPackageName = Stainless KeyLength = 0 ProcessId = 0x0000000000000244 ProcessName = C:/Windows/System32/services.exe IpAddress = 10.0.0.0 IpPort = 10.5.3.2 ImpersonationLevel = %%1122
` If there is another way to perform with awk and also, I would like to use basic bash and associative array. Please, also give me kind explanation...for me (noob).
KeiTheNoop (39 rep)
Oct 21, 2019, 07:22 AM • Last activity: Oct 22, 2019, 01:36 AM
0 votes
1 answers
134 views
Sync 1 config file amongst multiple directories
Lets say I have 4 java instances running on my linux system, in separate directories, all of which have a config file named config.yml. I want to be able to edit 1 config.yml and have it copy across the multiple directories in real time. For example: - ../dir1/config.yml - ../dir2/config.yml - ../di...
Lets say I have 4 java instances running on my linux system, in separate directories, all of which have a config file named config.yml. I want to be able to edit 1 config.yml and have it copy across the multiple directories in real time. For example: - ../dir1/config.yml - ../dir2/config.yml - ../dir3/config.yml - ../dir4/config.yml I want dir2 and dir3 to reference the config.yml in dir1. Is there a linux-based program or software that will allow me to do this? Or allow me to quickly sync the config.yml file across the directories? In addition to this question, would it be possible to have it sync across multiple systems, too? Thanks in advance!
ScottehBoeh (3 rep)
Jun 20, 2019, 12:49 PM • Last activity: Jun 20, 2019, 12:59 PM
-1 votes
1 answers
958 views
I want to extract part of a line using sed and backreference
1.The Greater Company :(Ranked 2) 5.United Taxi Service :(Ranked 3) 31.The Cacao Company :(Ranked 4) 40.Monster Inc. :(Ranked 5) 55.Afala, Industrial Strength :(Ranked 6) 60.The North Company :(Ranked 7) I want to display just the company number and company name. I do not want the rest of the line t...
1.The Greater Company :(Ranked 2) 5.United Taxi Service :(Ranked 3) 31.The Cacao Company :(Ranked 4) 40.Monster Inc. :(Ranked 5) 55.Afala, Industrial Strength :(Ranked 6) 60.The North Company :(Ranked 7) I want to display just the company number and company name. I do not want the rest of the line to be displayed. 1.The Greater Company 5.United Taxi Service 31.The Cacao Company 40.Monster Inc. 55.Afala, Industrial Strength 60.The North Company I can do this by sed 's/: .* //' filename.txt. How would I use this pattern with back reference so I can achieve the above result. The pattern that I want to match would be ([0-9]* .* :).
Rashad (141 rep)
Feb 16, 2018, 01:08 AM • Last activity: Feb 28, 2018, 10:33 PM
2 votes
2 answers
1015 views
how to get the size of an indirect array in bash?
Without using eval. this wont work: astr=(a b c) str="#astr[@]" echo "${!str}"
Without using eval. this wont work: astr=(a b c) str="#astr[@]" echo "${!str}"
Aquarius Power (4537 rep)
May 6, 2016, 12:04 AM • Last activity: Jun 29, 2017, 08:15 AM
2 votes
1 answers
303 views
Is there a reference for the assembler-like output produced by `awk -W dump`?
The command `awk -W dump ...` produces a dump of "assembler-like" code (as shown [here \[link\]][1], or by reading the `man`). Some of the instructions are easy to guess at their meaning such as `jz`, which is produced by an `if` statement and is clearly a _jump zero_ instruction. But others are les...
The command awk -W dump ... produces a dump of "assembler-like" code (as shown [here \[link\]][1] , or by reading the man). Some of the instructions are easy to guess at their meaning such as jz, which is produced by an if statement and is clearly a _jump zero_ instruction. But others are less so. Surprisingly, I can find no reference to the instruction set awk defines which seriously limits the utility of such output. Is there any such reference online?
Allen (206 rep)
Jan 22, 2016, 03:48 AM • Last activity: May 19, 2017, 01:16 PM
32 votes
5 answers
23968 views
Best resources to learn bash scripting?
I've programmed in a number of languages for two years now, I mean that I know how to design and implement a decent solution for a given problem. However, bash is being a major headache to me, just nothing does work as expected—or even without errors. All of the guides I've found were incredibly inf...
I've programmed in a number of languages for two years now, I mean that I know how to design and implement a decent solution for a given problem. However, bash is being a major headache to me, just nothing does work as expected—or even without errors. All of the guides I've found were incredibly informal, not properly summarising its syntax or telling the most common errors you can make. So what can you recommend me?
deprecated (2871 rep)
Apr 28, 2011, 05:55 PM • Last activity: Feb 11, 2017, 02:20 PM
3 votes
1 answers
309 views
What has happened w.r.t books about linux device driver programming in the last eight years?
This is probably a silly-sounding question, but one that I think there exists an objectively right answer to which makes me compelled to ask it. I am trying to understand the fundamentals of linux systems and especially how device drivers work so I went on the hunt for a good book on the subject. *E...
This is probably a silly-sounding question, but one that I think there exists an objectively right answer to which makes me compelled to ask it. I am trying to understand the fundamentals of linux systems and especially how device drivers work so I went on the hunt for a good book on the subject. *Essential Linux Device Drivers* has gotten very good reviews so I decided to buy it, without really noticing that it was released in 2008 and contains tons of examples referring to kernel version 2.6.3! This made me wonder if I should get a newer book. Just from browsing Amazon, there hardly seem to exists any newer books on the subject - not even newer editions. I wonder if there is a good explanation for this? I know that Linux used to have a reputation for being a nightmare when it came to interacting with external hardware, but at some point this problem was solved. Does this have any connection to the scarcity of recent literature on linux device driver programming?
embedded_crysis (337 rep)
Dec 6, 2016, 09:08 PM • Last activity: Dec 6, 2016, 09:36 PM
1 votes
2 answers
1015 views
What do the options after a specific command mean?
How do I understand what the various options/flags mean? For example: 1) `uname -a` - What does `-a` denote here? 2) `pyang -f` - What does `-f` denote here? I just want to understand if there is some reference/doc that tells the usage of these? Please clarify.
How do I understand what the various options/flags mean? For example: 1) uname -a - What does -a denote here? 2) pyang -f - What does -f denote here? I just want to understand if there is some reference/doc that tells the usage of these? Please clarify.
fsociety (149 rep)
Sep 3, 2016, 03:01 PM • Last activity: Sep 4, 2016, 12:46 PM
Showing page 1 of 20 total questions