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

229
votes
9answers
101k 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 ...
110
votes
28answers
36k 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 ...
108
votes
3answers
41k 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?
93
votes
5answers
23k 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 ...
75
votes
2answers
11k views

Why do we use su - and not just su?

I don't understand why su - is preferred over su to login as root.
72
votes
3answers
11k 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?
72
votes
9answers
27k views

Why would someone choose FreeBSD over Linux? [closed]

Why would someone choose FreeBSD over Linux? What are the advantages of FreeBSD compared to Linux? (My shared hosting provider uses FreeBSD.)
71
votes
13answers
98k 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.
71
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
9k 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
3answers
37k 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 ...
61
votes
12answers
194k 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 ...
55
votes
16answers
41k 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 ...
55
votes
3answers
30k 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 ...
55
votes
5answers
27k 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?
53
votes
15answers
5k views

How do you choose a distribution? [closed]

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, ...
52
votes
1answer
63k 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, ...
49
votes
8answers
55k 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 + ...
48
votes
10answers
34k 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 ...
47
votes
2answers
35k 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?
47
votes
5answers
25k 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 ...
46
votes
14answers
37k 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.
46
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 ...
46
votes
4answers
44k 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 ...
44
votes
7answers
83k 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 ...
44
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?
43
votes
5answers
32k 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, ...
42
votes
11answers
17k 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.
39
votes
8answers
27k 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 ...
39
votes
11answers
10k 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
45k views

How do you empty the buffers and cache on a Linux system?

Prior to doing some benchmarking work how would one free up the memory (RAM) that the Linux Kernel is consuming for its buffers and cache?
37
votes
5answers
19k 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 ...
36
votes
6answers
7k 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, ...
36
votes
4answers
4k 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?
36
votes
9answers
10k 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 ...
35
votes
4answers
47k 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?
34
votes
6answers
23k 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?
34
votes
8answers
6k 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, ...
34
votes
3answers
14k 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 ...
34
votes
7answers
6k 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 ...
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?
34
votes
4answers
13k views

Can linux deal with ultra high resolution displays?

A few months ago Samsung announced the Ativ Book 9 Plus. A pretty cool ultrabook with a screen resolution of 3200 x 1800 pixels (QHD+). The device ships with Windows 8 until Windows 8.1 will be ...
33
votes
4answers
21k 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 ...
33
votes
3answers
24k views

Why do I need a tty to run sudo if I can sudo without a password?

I have configured sudo to run without a password, but when I try to ssh 'sudo Foo", I still get sudo: sorry, you must have a tty to run sudo. Why does this happen and how can I work around it?
33
votes
3answers
33k views

How can I use the “mail” command?

I am not great at using the mail command on Linux. How can I get better? I don't even know what program this is. Is it pine? I doubt it. It is in /usr/bin/mail and when I start it is tells me that it ...
31
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 ...
31
votes
9answers
34k views

Linux distribution geared towards developers [closed]

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 ...
31
votes
1answer
851 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 ...
30
votes
9answers
12k 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 ...
30
votes
3answers
16k views

How to know if a disk is an SSD or an HDD

I want to know whether a disk is a solid-state drive or hard disk. lshw is not installed. I do yum install lshw and it says there is no package named lshw. I do not know which version of ...