Questions tagged [linux]

LINUX QUESTIONS MUST BE PROGRAMMING RELATED. 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

205121 questions
6002
votes
52 answers

How do I find all files containing specific text on Linux?

I'm trying to find a way to scan my entire Linux system for all files containing a specific string of text. Just to clarify, I'm looking for text within the file, not in the file name. When I was looking up how to do this, I came across this…
Nathan
  • 65,860
  • 11
  • 32
  • 47
2226
votes
17 answers

How can I recursively find all files in current and subfolders based on wildcard matching?

How can I recursively find all files in current and subfolders based on wildcard matching?
john
  • 26,310
  • 11
  • 41
  • 57
2098
votes
31 answers

How to change the output color of echo in Linux

I am trying to print a text in the terminal using echo command. I want to print the text in a red color. How can I do that?
satheesh.droid
  • 24,169
  • 8
  • 32
  • 33
2030
votes
18 answers

How can I symlink a file in Linux?

I want to make a symbolic link in Linux. I have written this Bash command where the first path is the folder I want link into and the second path is the compiled source. ln -s '+basebuild+'/IpDome-kernel/kernel…
chrisg
  • 36,063
  • 33
  • 82
  • 104
1973
votes
20 answers

How to change permissions for a folder and its subfolders/files in one step?

I would like to change the permissions of a folder and all its subfolders and files in one step (command) in Linux. I have already tried the below command but it works only for the mentioned folder: chmod 775 /opt/lampp/htdocs Is there a way to set…
Adam Halasz
  • 51,803
  • 63
  • 138
  • 208
1944
votes
19 answers

How can I profile C++ code running on Linux?

I have a C++ application, running on Linux, which I'm in the process of optimizing. How can I pinpoint which areas of my code are running slowly?
Gabriel Isenberg
  • 23,909
  • 4
  • 34
  • 57
1841
votes
26 answers

How do I grep recursively?

How do I recursively grep all directories and subdirectories? find . | xargs grep "texthere" *
wpiri
  • 18,559
  • 3
  • 15
  • 6
1804
votes
51 answers

How can I update NodeJS and NPM to the next versions?

I just installed Node.js and npm (for additional modules). How can I update Node.js and the modules which I'm using to the latest versions? Can npm do it, or do I have to remove and reinstall Node.js and npm to get the next versions? I followed this…
Dail
  • 18,261
  • 3
  • 13
  • 5
1797
votes
5 answers

How do I delete an exported environment variable?

Before installing gnuplot, I set the environment variable GNUPLOT_DRIVER_DIR = /home/gnuplot/build/src. During the installation, something went wrong. I want to remove the GNUPLOT_DRIVER_DIR environment variable. How can I achieve it?
A. K.
  • 26,873
  • 15
  • 44
  • 74
1733
votes
5 answers

What is ":-!!" in C code?

I bumped into this strange macro code in /usr/include/linux/kernel.h: /* Force a compilation error if condition is true, but also produce a result (of value 0 and type size_t), so the expression can be used e.g. in a structure initializer (or…
chmurli
  • 14,332
  • 3
  • 13
  • 12
1616
votes
15 answers

Looping through the content of a file in Bash

How do I iterate through each line of a text file with Bash? With this script: echo "Start!" for p in (peptides.txt) do echo "${p}" done I get this output on the screen: Start! ./runPep.sh: line 3: syntax error near unexpected token…
Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
1610
votes
42 answers

How to exclude a directory in find . command

I'm trying to run a find command for all JavaScript files, but how do I exclude a specific directory? Here is the find code we're using. for file in $(find . -name '*.js') do java -jar config/yuicompressor-2.4.2.jar --type js $file -o $file done
helion3
  • 27,515
  • 13
  • 48
  • 91
1576
votes
33 answers

How do I prompt for Yes/No/Cancel input in a Linux shell script?

I want to pause input in a shell script, and prompt the user for choices. The standard Yes, No, or Cancel type question. How do I accomplish this in a typical bash prompt?
Myrddin Emrys
  • 36,888
  • 10
  • 36
  • 47
1254
votes
16 answers

UTF-8 all the way through

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1. Where exactly do I need to set the encoding/charsets?…
mercutio
  • 20,943
  • 10
  • 33
  • 37
1252
votes
3 answers

How do I copy folder with files to another folder in Unix/Linux?

I am having some issues to copy a folder with files in that folder into another folder. Command cp -r doesn't copy files in the folder.
user2080656
  • 12,637
  • 3
  • 11
  • 4
1
2 3
99 100