Questions specifically about Linux, as opposed to Unix-like systems in general, or to questions about a specific distribution or program.

learn more… | top users | synonyms

266
votes
7answers
23k views

Understanding the Linux kernel source

I am trying to understand how a function, say mkdir, works by looking at the kernel source. This is an attempt to understand the kernel internals and navigate between various functions. I know mkdir ...
167
votes
7answers
72k views

When should I not kill -9 a process?

I am always very hesitant to run kill -9, but I see other admins do it almost routinely. I figure there is probably a sensible middle ground, so: When and why should kill -9 be used? When and why ...
78
votes
6answers
13k views

Is Linux a Unix?

So, there are lots of different versions of Unix out there: HP-UX, AIX, BSD, etc. Linux is considered a Unix clone rather than an implementation of Unix. Are all the "real" Unices actual descendants ...
72
votes
3answers
22k views

Why do directories need the executable (X) permission to be opened?

In my CMS, I noticed that directories need the executable bit (+x) set for the user to open them. Why is the execute permission required to read a directory?
69
votes
3answers
10k views

Why is the root directory denoted by a / sign?

I have done some research about this on Google, but the results were cloudy. Why is the / sign used to denote the root directory. Are there any solid reasons behind it?
67
votes
2answers
7k views

Why do we use su - and not just su?

I don't understand why su - is preferred over su to login as root.
63
votes
12answers
7k views

What is the benefit of compiling your own linux kernel?

What benefit could I see by compiling a Linux kernel myself? Is there some efficiency you could create by customizing it to your hardware?
61
votes
9answers
18k views

Why would someone choose FreeBSD over Linux?

Why would someone choose FreeBSD over Linux? What are the advantages of FreeBSD compared to Linux? (My shared hosting provider uses FreeBSD.)
52
votes
3answers
27k views

How do I read from /proc/$pid/mem under Linux?

The Linux proc(5) man page tells me that /proc/$pid/mem “can be used to access the pages of a process's memory”. But a straightforward attempt to use it only gives me $ cat /proc/$$/mem ...
51
votes
15answers
4k views

How do you choose a distribution?

I'm currently looking at putting a Linux (although BSD is still an option) distribution on my old laptop. However, I'm not sure how to wade through all of my options - rolling releases versus not, ...
49
votes
11answers
62k views

How can I resolve a hostname to an IP address in a Bash script?

What's the most concise way to resolve a hostname to an IP address in a Bash script? I'm using Arch Linux.
49
votes
5answers
20k views

What are high memory and low memory on Linux?

I'm interested in the difference between Highmem and Lowmem: Why is there such a differentiation? What do we gain by doing so? What features does each have?
48
votes
18answers
117k views

How do I find out what hard disks are in the system?

I need to know what hard disks are available, including ones that aren't mounted and possibly aren't formatted. I can't find them in dmesg or /var/log/messages (too much to scroll through). I'm hoping ...
42
votes
7answers
18k views

Convince apt-get *not* to use IPv6 method

The ISP I work at is setting up an internal IPv6 network in preparation for eventually connecting to the IPv6 internet. As a result, several of the servers in this network now try to connect to ...
41
votes
9answers
27k views

How do I choose a graphics card for Linux?

I'm building or buying a new Linux system, and I'm trying to select the best graphics card for my needs. How do I go about making this decision? There's dozens of computer-gear review sites which ...
40
votes
14answers
23k views

Determine the size of a block device

How can I find out the size of a block device, such as /dev/sda? Running ls -l gives no useful information.
40
votes
11answers
11k views

Recommended reading to better understand Unix/Linux internals

I've worked on *nix environments for the last four years as a application developer (mostly in C). Please suggest some books/blogs etc. for improving my *nix internals knowledge.
38
votes
6answers
2k views

Does `sl` ever show the current directory?

For those out of the loop, sl is a humourous command line tool that is meant to trip people up if they mistype ls. When invoked it prints a Steam Locomotive. For example: ( ...
38
votes
2answers
25k views

Linux: Difference between /dev/console , /dev/tty and /dev/tty0

On a Linux system, what is the difference between /dev/console , /dev/tty and /dev/tty0 ? What is their respective use? How do they compare?
37
votes
11answers
6k views

Is it good to make a separate partition for /boot?

I've seen some people make a separate partition for /boot. What is the benefit of doing this? What problems might I encounter in the future by doing this? Also, except for /home and /boot, which ...
37
votes
5answers
23k views

What is a Superblock, Inode, Dentry and a File?

From the article Anatomy of Linux File Systems by Tim Jones, I read that Linux views all the file systems from the perspective of a common set of objects and these objects are superblock, inode, ...
37
votes
5answers
17k views

Can I configure my Linux system for more aggressive file system caching?

I am neither concerned about RAM usage (as I've got enough) nor about losing data in case of an accidental shut-down (as my power is backed, the system is reliable and the data are not critical). But ...
36
votes
2answers
18k views

What do the flags in /proc/cpuinfo mean?

How can I tell whether my processor has a particular feature? (64-bit instruction set, hardware-assisted virtualization, cryptographic accelerators, etc.) I know that the file /proc/cpuinfo contains ...
36
votes
5answers
2k views

How to compile the C compiler from scratch, then compile Unix/Linux from scratch

Let's say I work for a large services organisation outside the US/UK. We use UNIX and Linux servers extensively. Reading through this article it mentions that it would be easy to insert a backdoor ...
35
votes
11answers
21k views

How can I get my external IP address in bash?

I need to find my external IP address from a bash script. At the moment I use this function: myip () { lwp-request -o text checkip.dyndns.org | awk '{ print $NF }' } But it depends on ...
35
votes
4answers
27k views

Limit memory usage for a single Linux process

I'm running pdftoppm to convert a user-provided PDF into a 300DPI image. This works great, except if the user provides an PDF with a very large page size. pdftoppm will allocate enough memory to ...
34
votes
1answer
1k views

Diagram of Linux kernel vs. performance tools?

Is there a diagram that shows how the various performance tools such as ip, netstat, perf, top, ps, etc. interact with the various subsystems within the Linux kernel?
34
votes
7answers
2k views

ZFS under linux, does it work?

Could I get ZFS to work properly in Linux? Are there any caveats / limitations?
33
votes
4answers
3k views

Why is Linux commonly used as operating system for supercomputers?

As of november 2010, Linux is used on 459 out of the 500 supercomputers of the TOP500. What are the reasons behind this massive use of Linux in the supercomputer space?
33
votes
1answer
38k views

In Linux “top” command what are us, sy, ni, id, wa, hi, si and st (for CPU usage)?

When I issue $ top in linux, I get a result similar to this (see here). One of the lines has CPU usage information represented like this: Cpu(s): 87.3%us, 1.2%sy, 0.0%ni, 27.6%id, 0.0%wa, ...
32
votes
8answers
32k views

What to do when a linux desktop freezes?

I'm a Windows guy, dual booted recently, and now I'm using Linux Mint 12 When a Windows desktop freezes I refresh, or if I am using a program I use alt + F4 to exit the program or I can use ctrl + ...
32
votes
6answers
17k views

How can I edit multiple files in VIM?

I know I can open multiple files with vim by doing something like vim 2011-12*.log, but how can I switch between files and close the files one at a time? Also, how can I tell the file name of the ...
32
votes
6answers
5k views

Software developer switching from Linux to OS X, what are the gotchas?

I have used Ubuntu/Fedora/Red Hat/Suse but haven't used OS X at all. If I have to start using OS X regularly, what are the things I should look out for? Tools I use are GNU tool chain, C++/Boost, ...
32
votes
5answers
14k views

Difference between /bin and /usr/bin

I read this up on this website and it doesn't make sense. http://rcsg-gsir.imsb-dsgi.nrc-cnrc.gc.ca/documents/basic/node32.html When UNIX was first written, /bin and /usr/bin physically resided ...
32
votes
9answers
8k views

Easy incremental backups to an external hard drive

For a while I used Dirvish to do incremental backups of my machines, but it is slightly cumbersome to configure, and if you do not carry a copy of your configuration it can be hard to reproduce ...
30
votes
6answers
10k views

How do I know if a partition is ext2, ext3, or ext4?

I just formatted stuff. One disk I format as ext2. The other I want to format as ext4. I want to test how they perform. Now, how do I know the kind of file system in a partition?
30
votes
4answers
15k views

Moving linux install to a new computer

I know that it can, in some circumstances, be difficult to move a Windows installation from one computer to another (physically move the hard drive), but how does that work on linux? Aren't most of ...
30
votes
4answers
2k views

unix, difference between path starting with '/' and '//'

In unix/linux, any number of consecutive forwardslashes in a path is generally equivalent to a single forwardslash. eg. $ cd /home/shum $ pwd /home/shum $ cd /home//shum $ pwd /home/shum $ cd ...
30
votes
4answers
19k views

What is the difference between reboot , init 6 and shutdown -r now?

I just want to know difference between in reboot init 6 shutdown -r now and which is the safest and the best?
29
votes
1answer
697 views

What happens when Ctrl + Alt + F<Num> is pressed?

I am looking for an explanation of what happens in Linux when this key combination is pressed to change the current terminal. In particular, what software component intercepts this key combination and ...
28
votes
7answers
4k views

Why does mount require root privileges?

Why does Linux require that a user be root/using sudo/specifically authorized per mount in order to mount something? It seems like the decision as to whether to allow a user to mount something should ...
28
votes
4answers
899 views

How can I mount a block device from one computer to another via the network as a block device?

Is it possible to export a block device such as a DVD or CDROM and make it so that it's mountable on another computer as a block device? NOTE: I'm not interested in doing this using NFS or Samba, I ...
27
votes
9answers
8k views

Why put things other than /home to a separate partition?

So recently a Debian 5.0.5 installer offered me to have separate /usr, /home, /var and /tmp partitions (on one physical disk). What is the practical reason for this? I understand that /home can be ...
27
votes
7answers
35k views

How can I monitor disk io?

I'd like to do some general disk io monitoring on a debian linux server. What are the tools I should know about that monitor disk io so I can see if a disk's performance is maxed out or spikes at ...
27
votes
7answers
2k views

Easy way to determine virtualization technology

I have command line access to a Linux machine which may or may not be virtualized. I want to determine what kind of virtualization technology it runs on, if any (VMWare, VirtualBox, KVM, OpenVZ, Xen, ...
27
votes
3answers
10k views

How do SO (shared object) numbers work?

I'm aware that shared objects under Linux use "so numbers", namely that different versions of a shared object are given different extensions, for example: example.so.1 example.so.2 I understand ...
27
votes
4answers
960 views

Execution of possibly harmful program on Linux

I'm writing a program that will test programs written by students. I'm afraid that I can't trust them and I need to make sure that it won't end up badly for the computer running it. I was thinking ...
27
votes
5answers
18k views

How to reconnect a logically disconnected USB device?

It is possible for a USB storage device to become logically disconnected: the device is still plugged in, but is invisible from the operating system (e.g. it's not listed under /proc/bus/usb). Maybe ...
26
votes
2answers
1k views

Why does a software package run just fine even when it is being upgraded?

Say I am running a software, and then I run package manager to upgrade the software, I notice that Linux does not bring down the running process for package upgrade - it is still running fine. How ...
26
votes
2answers
5k views

What is this new /run filesystem?

I just ran df -h a minute ago and noticed a filesystem has been added that I'm not familiar with. Does anyone know why /run exists? Is this something that's been added by the kernel? By Arch Linux? ...