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
851
votes
40 answers

How do I test if a variable is a number in Bash?

I just can't figure out how do I make sure an argument passed to my script is a number or not. All I want to do is something like this: test *isnumber* $1 && VAR=$1 || echo "need a number" Any help?
Flávio Amieiro
  • 41,644
  • 8
  • 32
  • 24
850
votes
31 answers

Argument list too long error for rm, cp, mv commands

I have several hundred PDFs under a directory in UNIX. The names of the PDFs are really long (approx. 60 chars). When I try to delete all PDFs together using the following command: rm -f *.pdf I get the following error: /bin/rm: cannot execute…
Vicky
  • 16,679
  • 54
  • 139
  • 232
842
votes
2 answers

How do SO_REUSEADDR and SO_REUSEPORT differ?

The man pages and programmer documentations for the socket options SO_REUSEADDR and SO_REUSEPORT are different for different operating systems and often highly confusing. Some operating systems don't even have the option SO_REUSEPORT. The WWW is…
Mecki
  • 125,244
  • 33
  • 244
  • 253
836
votes
14 answers

How to kill all processes with a given partial name?

I want to kill all processes that I get by: ps aux | grep my_pattern How to do it? This does not work: pkill my_pattern
Łukasz Lew
  • 48,526
  • 41
  • 139
  • 208
832
votes
19 answers

Sleep for milliseconds

I know the POSIX sleep(x) function makes the program sleep for x seconds. Is there a function to make the program sleep for x milliseconds in C++?
Prasanth Madhavan
  • 12,657
  • 15
  • 62
  • 94
818
votes
25 answers

How can I copy the output of a command directly into my clipboard?

How can I pipe the output of a command into my clipboard and paste it back when using a terminal? For instance: cat file | clipboard
Legend
  • 113,822
  • 119
  • 272
  • 400
801
votes
13 answers

What killed my process and why?

My application runs as a background process on Linux. It is currently started at the command line in a Terminal window. Recently a user was executing the application for a while and it died mysteriously. The text: Killed was on the terminal. This…
sbq
  • 8,049
  • 3
  • 17
  • 5
800
votes
28 answers

How to replace a string in multiple files in linux command line

I need to replace a string in a lot of files in a folder, with only ssh access to the server. How can I do this?
mridul4c
  • 8,197
  • 3
  • 19
  • 28
777
votes
62 answers

Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running?

I have applied every solution available on internet but still I cannot run Docker. I want to use Scrapy Splash on my server. Here is history of commands I ran. docker run -p 8050:8050 scrapinghub/splash sudo docker run -p 8050:8050…
Umair Ayub
  • 19,358
  • 14
  • 72
  • 146
769
votes
14 answers

ImageMagick security policy 'PDF' blocking conversion

The Imagemagick security policy seems to be not allowing me perform this conversion from pdf to png. Converting other extensions seem to be working, just not from pdf. I haven't changed any of the imagemagick settings since I installed it... I am…
T. Zack Crawford
  • 7,646
  • 3
  • 11
  • 18
766
votes
13 answers

Print a file, skipping the first X lines, in Bash

I have a very long file which I want to print, skipping the first 1,000,000 lines, for example. I looked into the cat man page, but I did not see any option to do this. I am looking for a command to do this or a simple Bash program.
Eduardo
  • 19,928
  • 23
  • 65
  • 73
762
votes
26 answers

How do I know the script file name in a Bash script?

How can I determine the name of the Bash script file inside the script itself? Like if my script is in file runme.sh, then how would I make it to display "You are running runme.sh" message without hardcoding that?
Ma99uS
  • 10,605
  • 8
  • 32
  • 42
750
votes
12 answers

How do I write standard error to a file while using "tee" with a pipe?

I know how to use tee to write the output (standard output) of aaa.sh to bbb.out, while still displaying it in the terminal: ./aaa.sh | tee bbb.out How would I now also write standard error to a file named ccc.out, while still having it displayed?
jparanich
  • 8,372
  • 4
  • 26
  • 34
748
votes
4 answers

How to download a file from server using SSH?

I need to download a file from server to my desktop. (UBUNTU 10.04) I don't have a web access to the server, just ssh. If it helps, my OS is Mac OS X and iTerm 2 as a terminal.
NiLL
  • 13,645
  • 14
  • 46
  • 59
746
votes
7 answers

How do I get cURL to not show the progress bar?

I'm trying to use cURL in a script and get it to not show the progress bar. I've tried the -s, -silent, -S, and -quiet options, but none of them work. Here's a typical command I've tried: curl -s http://google.com > temp.html I only get the…
adammenges
  • 7,848
  • 5
  • 26
  • 33