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

30
votes
10answers
11k 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?
30
votes
4answers
4k 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 ...
30
votes
2answers
8k 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? ...
30
votes
9answers
9k 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 ...
28
votes
4answers
14k 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 ...
28
votes
4answers
25k 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 ...
28
votes
3answers
8k 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 ...
28
votes
5answers
25k 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 ...
27
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 ...
27
votes
3answers
3k 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 ...
27
votes
2answers
33k 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 ...
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 ...
26
votes
12answers
36k 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 ...
26
votes
5answers
26k 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
7answers
27k 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 ...
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
3k 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 ...
26
votes
3answers
7k 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 ...
26
votes
2answers
22k 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 ...
25
votes
2answers
3k 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
18k 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
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
5answers
16k 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
11answers
12k 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: ...
23
votes
6answers
29k 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.
23
votes
1answer
12k 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 ...
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 ...
23
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 ...
22
votes
10answers
30k views

List partition labels from the command line

Is there a command that will list all partitions along with their labels? sudo fdisk -l and sudo parted -l don't show labels by default. EDIT: (as per comment below) I'm talking about ext2 labels - ...
22
votes
5answers
3k 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
4answers
14k views

How to display meminfo in megabytes in top?

Sometimes it is not comfortable to see meminfo in kilobytes while you have several gigs of RAM. In Linux it looks like that: And here is how it looks in Mac OS X: Is there a way to display ...
22
votes
3answers
1k views

How can I shutdown a RHEL server at 06:45 tomorrow morning?

I just received notification that our site has a power outage tomorrow morning. I am a Windows admin but I have to cover for our Linux admin who's not around until tomorrow evening. I need to ...
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
7k 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
7answers
6k 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 ...
22
votes
4answers
52k views

Can I set up system mail to use an external SMTP server?

Is it possible to set up system mail on a linux box to be sent via a different smtp server - maybe even with authentication? If so, how do I do this? If that's unclear, let give an example. If I'm at ...
22
votes
7answers
5k 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
5answers
9k 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: ...
22
votes
4answers
2k views

Kernel Hacking Environment

I have been working in embedded OS like uCOS, ThreadX. While I have coded apps in Linux, now I’m planning to start learning Linux Kernel. I have few questions regarding the environment. Which is ...
21
votes
5answers
34k views

Uploading directories with sftp?

I'm having some trouble uploading directories(which contain other directories a few levels deep) by sftp. I realize I could work around this by gzipping, but I don't see why that's necessary. Anyway, ...
21
votes
4answers
7k 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?
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
7k 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
1k 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 ...