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
1237
votes
23 answers

Merge / convert multiple PDF files into one PDF

How could I merge / convert multiple PDF files into one large PDF file? I tried the following, but the content of the target file was not as expected: convert file1.pdf file2.pdf merged.pdf I need a very simple/basic command line (CLI) solution.…
alcohol
  • 19,052
  • 4
  • 21
  • 21
1227
votes
27 answers

How to count lines in a document?

I have lines like these, and I want to know how many lines I actually have... 09:16:39 AM all 2.00 0.00 4.00 0.00 0.00 0.00 0.00 0.00 94.00 09:16:40 AM all 5.00 0.00 0.00 4.00 0.00 0.00 0.00 0.00 …
Alucard
  • 14,592
  • 7
  • 21
  • 22
1205
votes
4 answers

How can I use grep to show just filenames on Linux?

How can I use grep to show just file-names (no in-line matches) on Linux? I am usually using something like: find . -iname "*php" -exec grep -H myString {} \; How can I just get the file-names (with paths), but without the matches? Do I have to use…
cwd
  • 47,510
  • 50
  • 154
  • 194
1173
votes
10 answers

How to redirect output to a file and stdout

In bash, calling foo would display any output from that command on the stdout. Calling foo > output would redirect any output from that command to the file specified (in this case 'output'). Is there a way to redirect output to a file and have it…
SCdF
  • 51,261
  • 23
  • 74
  • 108
1128
votes
11 answers

Remove a symlink to a directory

I have a symlink to an important directory. I want to get rid of that symlink, while keeping the directory behind it. I tried rm and get back rm: cannot remove 'foo'. I tried rmdir and got back rmdir: failed to remove 'foo': Directory not empty I…
Matthew Scouten
  • 14,410
  • 8
  • 30
  • 46
1081
votes
31 answers

Pipe to/from the clipboard in Bash script

Is it possible to pipe to/from the clipboard in Bash? Whether it is piping to/from a device handle or using an auxiliary application, I can't find anything. For example, if /dev/clip was a device linking to the clipboard we could do: cat /dev/clip …
moinudin
  • 117,949
  • 42
  • 185
  • 213
1071
votes
14 answers

Defining a variable with or without export

What is export for? What is the difference between: export name=value and name=value
flybywire
  • 232,954
  • 184
  • 384
  • 491
1062
votes
5 answers

Why does the C preprocessor interpret the word "linux" as the constant "1"?

Why does the C preprocessor in GCC interpret the word linux (small letters) as the constant 1? test.c: #include int main(void) { int linux = 5; return 0; } Result of $ gcc -E test.c (stop after the preprocessing…
ahmedaly50
  • 7,309
  • 3
  • 10
  • 7
967
votes
15 answers

How do I use sudo to redirect output to a location I don't have permission to write to?

I've been given sudo access on one of our development RedHat linux boxes, and I seem to find myself quite often needing to redirect output to a location I don't normally have write access to. The trouble is, this contrived example doesn't work: sudo…
Jonathan
  • 23,467
  • 12
  • 62
  • 81
960
votes
14 answers

What is the meaning of "POSIX"?

What is POSIX? I have read the Wikipedia article and I read it every time I encounter the term. The fact is that I never really understood what it is. Can anyone please explain it to me by explaining "the need for POSIX" too?
claws
  • 47,010
  • 55
  • 140
  • 185
957
votes
24 answers

How to permanently set $PATH on Linux/Unix?

I'm trying to add a directory to my path so it will always be in my Linux path. I've tried: export PATH=$PATH:/path/to/dir This works, however each time I exit the terminal and start a new terminal instance, this path is lost, and I need to run the…
Click Upvote
  • 235,452
  • 251
  • 553
  • 736
951
votes
14 answers

Where can I find php.ini?

A few years ago I installed Apache 2.2x and PHP 5.3.1 on a Linux server I maintain. I used .tar.gz's and built them as instructed (instead of rpms and what-have-you). And all was fine. Today I need to install this which seems like a PHP library. I…
necromancer
  • 21,492
  • 19
  • 65
  • 111
949
votes
20 answers

git replacing LF with CRLF

Running git on a Windows XP machine, using bash. I exported my project from SVN, and then cloned a bare repository. I then pasted the export into the bare repositories directory, and did a: git add -A I then got a list of messages saying: LF will…
mrblah
  • 88,033
  • 134
  • 292
  • 404
943
votes
30 answers

How to kill a process running on particular port in Linux?

I tried to close the tomcat using ./shutdown.sh from tomcat /bin directory. But found that the server was not closed properly. And thus I was unable to restartMy tomcat is running on port 8080. I want to kill the tomcat process running on 8080. I…
veer7
  • 14,540
  • 8
  • 37
  • 62
940
votes
28 answers

Using ls to list directories and their total sizes

Is it possible to use ls in Unix to list the total size of a sub-directory and all its contents as opposed to the usual 4K that (I assume) is just the directory file itself? total 12K drwxrwxr-x 6 *** *** 4.0K 2009-06-19 10:10 branches drwxrwxr-x…
kmorris511
  • 13,542
  • 6
  • 26
  • 29