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

27
votes
10answers
9k views

How do I find how long ago a Linux system was installed?

How can I find the time since a Linux system was first installed, provided that nobody has tried to hide it?
27
votes
2answers
7k 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? ...
27
votes
4answers
20k views

Creating a ram disk on Linux

I have a machine with 62GB of RAM, and a trunk that's only 7GB, so I thought I would create a RAM disk and compile there. I am not a Linux expert. I found instructions on the internet to create the ...
27
votes
3answers
2k views

Can a bash script be hooked to a file?

I want a script to sleep unless a certain file is modifed/deleted (or a file created in a certain directory, or ...). Can this be achieved in some elegant way? The simplest thing that comes to my mind ...
27
votes
5answers
1k 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
23k 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
5answers
20k views

How to easily build your own Linux Distro? [duplicate]

I wanted to have a go at creating my very own Linux Distribution. Could you suggest some nice and easy-to-follow tutorials (preferably text based and not videos). I have heard something about Arch ...
26
votes
3answers
3k views

Does grep use a cache to speed up the searches?

I have noticed that subsequent runs of grep on the same query (and also a different query, but on the same file) are much faster than the first run (the effect is easily noticeable when searching ...
26
votes
2answers
2k views

Can TCP provide more than 65535 ports?

Is it possible to setup a Linux system so that it provides more than 65,535 ports? The intent would be to have more than 65k daemons listening on a given system. Clearly there are ports being used ...
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 ...
25
votes
6answers
22k views

Correctly determining memory usage in Linux

I'm a bit confused on some of the results I am seeing from "ps" and "free". On my server, this is the result of "free -m" [root@server ~]# free -m total used free shared ...
25
votes
2answers
2k views

Will Linux start killing my processes without asking me if memory gets short?

I was running a shell script with commands to run several memory-intensive programs (2-5 GB) back-to-back. When I went back to check on the progress of my script I was surprised to discover that some ...
25
votes
2answers
26k views

timestamp, modification time, and created time of a file

I just know that ls -t and ls -f give different sorting of files and subdirectories under a directory. What are the differences between timestamp, modification time, and created time of a file? How ...
25
votes
2answers
2k views

Why do some Linux distributions still have /dev/ttyS0, ttyS1, etc., even though newer computers don't have such a serial port?

Many new laptop and desktop computers do not have 9-pin/25-pin serial ports. Why do many Linux distributions still contain /dev/ttyS0, dev/ttyS1 device files? Since udev can create the device files ...
25
votes
12answers
3k views

How can I tweak my Linux desktop to be more responsive?

I have the experience that Linux works fine until the physical memory is exhausted. As soon as swap space is used the performance is severely degraded and the GUI becomes unresponsive. This problem ...
25
votes
7answers
16k views

Linux Kernel: Good beginners' tutorial

I'm interested in modifying the kernel internals, applying patches, handling device drivers and modules, for my own personal fun. Is there a comprehensive resource for kernel hacking, intended for ...
25
votes
1answer
1k views

Oldest binary working on Linux?

In a discussion on backwards-compatibility in Linux kernel and GUI ABIs, Alan Cox notes that "my 3.6rc kernel will still run a Rogue binary built in 1992. X is back compatible to apps far older than ...
24
votes
1answer
2k views

Were all Unix commands re-written in Linux?

I would like to know which commands were re-written for Linux and which were retained from Unix? I'm new to Linux.
24
votes
3answers
12k 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 ...
24
votes
6answers
3k views

Why isn't there a truly unified package manager for Linux?

Why isn't there a unified package manager that acts as an interface between the end-user and the underlying low-level package manager (apt, yast, pacman, etc.)? Is it hard to do and therefore not ...
24
votes
3answers
6k views

What is the difference between procfs and sysfs?

What is the difference between procfs and sysfs? Why are they made as file systems? As I understand it, proc is just something to store the immediate info regarding the processes running in the ...
24
votes
2answers
18k views

Difference between pts and tty

Possible Duplicate: What is the exact difference between a 'terminal', a 'shell', a 'tty' and a 'console'? I always see pts and tty when I use the who ...
23
votes
5answers
13k views

Why does Linux allow ‘init=/bin/bash’?

I recently found out that if I edit GRUB before booting and I add rw init=/bin/bash I end up with a root shell. Being in a condition that I want to understand everything I would like to know why this ...
23
votes
5answers
1k views

How to strip a Linux system?

I've been building a Linux distro, and I've stripped the binaries, etc. The system won't use GCC or development tools, as it will be a Chrome kiosk, so it would greatly help if I could strip down the ...
22
votes
12answers
29k views

Efficiently delete large directory containing thousands of files

We have an issue with a folder becoming unwieldy with hundreds of thousands of tiny files. There are so many files that performing rm -rf returns an error and instead what we need to do is something ...
22
votes
5answers
2k views

Is CTRL+C incorrect to use to return to command line?

When I'm using tail -f and I want to return to the shell, I always use CTRL+C. Or when I am typing a command and feel like aborting it and starting over, I simply CTRL+C to get back to an empty ...
22
votes
2answers
1k views

How frequently is the proc file system updated on Linux?

How frequently is the proc file system updated on Linux? Is it 20 milliseconds (time quantum)?
22
votes
3answers
2k views

When is a reboot required?

Apart from upgrading the kernel, are there any changes to a Linux system that require a reboot? I know there are situations where a reboot makes things easier, but are there any that cannot be ...
22
votes
2answers
6k views

What mount points exist on a typical Linux system?

I have 2 questions. During Linux installation we specify memory space for 2 mount points - root and swap. Are there any other mount points created without the users notice? Is this statement ...
22
votes
1answer
15k 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?
22
votes
3answers
6k views

Shell: how to go to the beginning of line when you are inside a screen?

I am inside a screen (screen -Ra). I have a long command, and I am at the end. Instead of keeping the left arrow, how can you go to the beginning of the line? CTRL-A works when I am in a normal ...
22
votes
7answers
4k views

How can I use DD to migrate data from an old drive to a new drive?

I am upgrading the internal SATA hard drive on my laptop from a 40G drive to a 160G drive. I have a Linux/Ubuntu desktop which has a SATA card. I would actually like to do the same thing for a couple ...
22
votes
1answer
6k views

What are ConsoleKit and PolicyKit? How do they work?

I've seen that recent GNU/Linux are using ConsoleKit and PolicyKit. What are they for? How do they work? The best answer should explain what kind of problem each one tries to solve, and how they ...
21
votes
2answers
3k views

Where is the fork() on the fork bomb :(){ :|: & };:?

Warning: Running this command in most shells will result in a broken system that will need a forced shutdown to fix I understand the recursive function :(){ :|: & };: and what it does. But I ...
21
votes
6answers
6k views

How do I correlate /dev/sd devices to the hardware they represent?

A drive is beginning to fail and I only know the device by its /dev/sdb device file designation. What are the ways that I can use to correlate that device file to an actual hardware device to know ...
21
votes
4answers
1k views

Is there a reason why 'owner' permissions exist? Aren't group permissions enough?

I think I rather understand how file permissions work in linux. However, I don't really understand why they are split into three levels and not into two. I'd like the following issues answered: Is ...
21
votes
4answers
617 views

How to find the driver (module) associated with a device on Linux?

On Linux, given: a device, for example /dev/sda, and its major and minor numbers, for example 8, 0, how can I know which module / driver is "driving" it? Can I dig into /sys or /proc to ...
21
votes
6answers
5k views

Force directory to always be in cache

I've been testing out different methods to improve the time it takes to compile my entire c++ project. Currently it takes ~5 minutes. I experimented with distcc, ccache, and others. Recently, I ...
21
votes
5answers
8k views

What is the difference between kernel drivers and kernel modules?

When I do a lspci -k on my Kubuntu with a 3.2.0-29-generic kernel I can see something like this: 01:00.0 VGA compatible controller: NVIDIA Corporation G86 [Quadro NVS 290] (rev a1) Subsystem: ...
20
votes
4answers
6k views

What makes OSX programs not runnable on Linux?

I know there are many differences between OSX and Linux, but what makes them so totally different, that makes them fundamentally incompatible?
20
votes
10answers
6k views

How can I reliably get the operating system's name?

Say I am logged into a remote system, how can I know what it's running? On most modern Linuxes (Linuces?), you have the lsb_release command: $ lsb_release -ic Distributor ID: LinuxMint Codename: ...
20
votes
4answers
5k views

What doesn't need defragmentation? Linux or the ext2 ext3 FS?

Why don't you have to defrag a Linux system? Because it's using the ext2/ext3 file system or because it's Linux? That's relevant, because a have a double boot system (W7 / Ubuntu) and a common ...
20
votes
2answers
7k views

A list of available DBus services

Is there such a thing as list of available DBus services? I've stumbled upon a few (like those provided by NetworkManager, Rhythmbox, Skype, HAL). I wonder if I can find a rather complete list of ...
20
votes
2answers
2k views

How do I make a file NOT modifiable?

While logged in, I can do the following: mkdir foo touch foo/bar chmod 400 foo/bar chmod 500 foo Then I can open vim (not as root), edit bar, force a write with w!, and the file is modified! How ...
20
votes
2answers
4k views

How do I remove a file with no permissions?

A hacker has dropped a file in my tmp dir that is causing issues. Nothing malicious except creating GB's of error_log entries because their script is failing. However, the file they are using to ...
20
votes
3answers
2k views

How can I set the processor affinity of a process on Linux?

The question is all in the title: How can I set the processor affinity of a process on Linux?
20
votes
1answer
10k views

Kernel inotify watch limit reached

I'm currently facing a problem on a linux box where as root I have commands returning error because inotify watch limit has been reached. # tail -f /var/log/messages [...] tail: cannot watch ...
19
votes
3answers
5k views

Why does Linux use a swap partition rather than a file?

It seems to me a swap file is more flexible.
19
votes
6answers
14k views

How to replace one char with another in all filenames of the current directories?

How do you rename all files/subdirs in the current folder? Lets say, I have many files and subdirs that are with spaces and I want to replace all the spaces with an underscore. File 1 File 2 File 3 ...
19
votes
6answers
18k views

How to find creation date of file?

I want to find out the creation date of particular file, not modification date or access date. I have tried with ls -ltrh and stat filename.