Questions tagged [linux]

NOTICE: All Linux questions must be related to programming; those that aren't will be closed. Use this tag only if your question relates to programming using Linux APIs or Linux-specific behavior, not just because you happen to run your code on Linux. If you need Linux support, you can try https://unix.stackexchange.com or the specific Linux distribution's Stack Exchange site like https://askubuntu.com or https://elementaryos.stackexchange.com/

GNU/Linux is a Unix-like computer operating system which consists of necessary user-space libraries and programs provided by GNU in Cambridge, Massachusetts and a kernel, developed by Linus Torvalds in Helsinki, Finland.

The GNU/Linux naming controversy is a dispute among members of the free and open-source software community over how to refer to the computer operating system commonly called .


Design

A GNU/Linux-based system is a modular Unix-like operating system. It derives much of its basic design from principles established in Unix during the 1970s and 1980s. Such a system uses a monolithic kernel that handles process control, networking, and peripheral and file system access. Device drivers are either integrated directly with the kernel or added as modules loaded while the system is running.

Separate projects that interface with the kernel provide much of the system's higher-level functionality. The GNU user land is an important part of most GNU/Linux-based systems, providing the most common implementation of the C library, a popular shell, and many of the common Unix tools which carry out many basic operating system tasks. The graphical user interface (or GUI) used by most GNU/Linux systems is built on top of an implementation of the X Window System.


Tag Usage

The tag on Stack Overflow is generally used for questions about:

  • programming against the APIs supplied by the operating system
  • the implementation of the kernel
  • programming tools and techniques for use on a Linux-based system.

Notable questions that probably don't belong are:

  • questions about using a desktop or laptop GNU/Linux system are better directed towards Super User, Unix & Linux, Ask Ubuntu, or Elementary OS if they're specifically about those distributions.
  • questions about administering GNU/Linux systems for other users and networking GNU/Linux systems in a context more complicated than a minimal home network are better directed towards Server Fault.

Many questions about GNU/Linux can also be properly tagged as , but some features are specific to GNU/Linux and are not found on other Unix™ and Unix-like operating systems. If you have questions about a specific distribution and version (e.g., , it may not be necessary to use this tag for that question.

A fair number of questions are questions about the command shell (bash by default on many systems), and are probably better tagged with and/or the particular shell you are interested in (, , , etc.).

Questions about the internals of the Linux kernel or regarding writing Linux kernel modules should be tagged .


Free Linux and GNU/Linux Books


Common GNU/Linux distributions

Distrowatch aggregates new release notices from these and hundreds of other GNU/Linux distributions, Phoronix keeps track of new GNU/Linux features and GNU/Linux Performance.


Other resources

Related tags

226061 questions
71
votes
6 answers

rm fails to delete files by wildcard from a script, but works from a shell prompt

I've run into a really silly problem with a Linux shell script. I want to delete all files with the extension ".bz2" in a directory. In the script I call rm "$archivedir/*.bz2" where $archivedir is a directory path. Should be pretty simple,…
EMP
  • 59,148
  • 53
  • 164
  • 220
71
votes
4 answers

tcp_tw_reuse vs tcp_tw_recycle : Which to use (or both)?

I have a website and application which use a significant number of connections. It normally has about 3,000 connections statically open, and can receive anywhere from 5,000 to 50,000 connection attempts in a few seconds time frame. I have had the…
Michael Marsee
  • 1,075
  • 2
  • 12
  • 11
71
votes
9 answers

Automating running command on Linux from Windows using PuTTY

I have a scenario where I need to run a linux shell command frequently (with different filenames) from windows. I am using PuTTY and WinSCP to do that (requires login name and password). The file is copied to a predefined folder in the linux…
Nemo
  • 24,540
  • 12
  • 45
  • 61
71
votes
2 answers

How does Linux emulator in Javascript by Fabrice Bellard work?

Today I had a jaw dropping moment, when I saw Linux emulator in Javascript: http://bellard.org/jslinux/ It compiles C programs, it has vi and emacs, it supports all shell commands, etc etc. How does it work?
Nikita Barsukov
  • 2,957
  • 3
  • 32
  • 39
71
votes
11 answers

How to copy and edit files in Android shell?

The Android shell does not have the cp command. Android shell also has no sed or grep or vi. I have no adb daemon available. There is mv command but it rejects to work if source is on a read-only device. What to do if I have to copy some…
psihodelia
  • 29,566
  • 35
  • 108
  • 157
71
votes
10 answers

How to parse XML using shellscript?

I would like to know what would be the best way to parse an XML file using shellscript ? Should one do it by hand ? Does third tiers library exist ? If you already made it if you could let me know how did you manage to do it
Spredzy
  • 4,982
  • 13
  • 53
  • 69
71
votes
1 answer

What happens if you use the 32-bit int 0x80 Linux ABI in 64-bit code?

int 0x80 on Linux always invokes the 32-bit ABI, regardless of what mode it's called from: args in ebx, ecx, ... and syscall numbers from /usr/include/asm/unistd_32.h. (Or crashes on 64-bit kernels compiled without CONFIG_IA32_EMULATION). 64-bit…
Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
71
votes
2 answers

"In-source builds are not allowed" in cmake

I'm new to cmake, and I'm only using it to install opencv on my ubuntu linux. Here's the command I ran: cmake -DCMAKE_BUILD_TYPE=Release DCMAKE_INSTALL_PREFIX=/home/jinha/OCV/source Then it returns the error: FATAL: In-source builds are not allowed.…
WannabeArchitect
  • 1,058
  • 2
  • 11
  • 22
71
votes
4 answers

How to set socket timeout in C when making multiple connections?

I'm writing a simple program that makes multiple connections to different servers for status check. All these connections are constructed on-demand; up to 10 connections can be created simultaneously. I don't like the idea of one-thread-per-socket,…
RichardLiu
  • 1,902
  • 1
  • 19
  • 18
71
votes
4 answers

Preemptive threads Vs Non Preemptive threads

Can someone please explain the difference between preemptive Threading model and Non Preemptive threading model? As per my understanding: Non Preemptive threading model: Once a thread is started it cannot be stopped or the control cannot be…
Alok Save
  • 202,538
  • 53
  • 430
  • 533
71
votes
5 answers

Example of using named pipes in Linux shell (Bash)

Can someone post a simple example of using named pipes in Bash on Linux?
Drew LeSueur
  • 19,185
  • 29
  • 89
  • 106
71
votes
6 answers

How to execute a shell script from C in Linux?

How can I execute a shell script from C in Linux?
Jan Deinhard
  • 19,645
  • 24
  • 81
  • 137
71
votes
4 answers

docker networking namespace not visible in ip netns list

When I create a new docker container like with docker run -it -m 560m --cpuset-cpus=1,2 ubuntu sleep 120 and check its namespaces, I can see that new namespaces have been created (example for pid 7047). root@dude2:~# ls /proc/7047/ns -la total…
christian
  • 9,412
  • 10
  • 41
  • 51
71
votes
3 answers

In Linux, what do all the values in the "top" command mean?

When you run top and see all running processes, I've always wanted to know just what everything actually means. e.g. all the various single-letter state codes for a running process (R = Running, S = Sleeping, etc...) Where can I find this?
Aaron Fi
  • 10,116
  • 13
  • 66
  • 91
71
votes
11 answers

How to send HTML email using linux command line

I need to send email with html format. I have only linux command line and command "mail". Currently have used: echo "To: address@example.com" > /var/www/report.csv echo "Subject: Subject" >> /var/www/report.csv echo "Content-Type: text/html;…
Oleh Herych
  • 897
  • 1
  • 9
  • 16