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

279
votes
7answers
24k 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 ...
215
votes
9answers
96k 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 ...
93
votes
26answers
12k views

Tracking down where disk space has gone on Linux?

When administering Linux systems I often find myself struggling to track down the culprit after a partition goes full. I normally use du / | sort -nr but on a large filesystem this takes a long time ...
87
votes
5answers
16k 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 ...
82
votes
3answers
28k 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?
74
votes
2answers
9k views

Why do we use su - and not just su?

I don't understand why su - is preferred over su to login as root.
71
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
9answers
4k 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: ( ...
66
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?
66
votes
9answers
21k views

Why would someone choose FreeBSD over Linux? [on hold]

Why would someone choose FreeBSD over Linux? What are the advantages of FreeBSD compared to Linux? (My shared hosting provider uses FreeBSD.)
61
votes
3answers
30k 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 ...
60
votes
12answers
76k 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.
54
votes
18answers
149k 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 ...
53
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, ...
53
votes
5answers
23k 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?
49
votes
3answers
23k 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 ...
44
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 ...
43
votes
14answers
28k 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.
43
votes
2answers
29k 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?
43
votes
9answers
30k 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 ...
43
votes
1answer
48k 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, ...
42
votes
13answers
28k 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 ...
42
votes
11answers
13k views

Recommended reading to better understand Unix/Linux internals [closed]

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.
42
votes
5answers
21k 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 ...
41
votes
4answers
34k 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 ...
39
votes
5answers
27k 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, ...
38
votes
8answers
21k 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 ...
38
votes
11answers
8k 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 ...
38
votes
1answer
2k 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?
36
votes
8answers
40k 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 + ...
36
votes
7answers
52k 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 ...
34
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?
34
votes
5answers
16k 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 ...
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
9answers
9k 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 ...
32
votes
6answers
14k 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?
32
votes
6answers
6k 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
4answers
17k 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 ...
32
votes
3answers
12k 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 ...
31
votes
4answers
29k 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?
30
votes
4answers
3k 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 ...
29
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 ...
29
votes
7answers
3k 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, ...
29
votes
1answer
778 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
9answers
10k 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 ...
28
votes
4answers
2k 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 ...
28
votes
10answers
26k views

Linux distribution geared towards developers

I am looking for the best flavor of Linux that would appeal to the developer's side of me. I am a lover of open source and use several different languages. Is there such a thing as a Linux geared ...
28
votes
7answers
8k views

A tool for automatically applying RandR configuration when external display is plugged in

is there a tool which enables one to: remember current RandR configuration (position, orientation, resolution etc) on per-monitor basis, automatically apply last known good configuration as soon as ...
27
votes
4answers
11k views

Difference Between cp -r and cp -R (copy command)

cp- r is meant to copy files recursively, and cp -R for copying directories recursively. But I've checked, and both appear to copy both files and directories, the same thing. So, what's the difference ...
27
votes
2answers
6k 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? ...