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

13
votes
3answers
2k views

Automatically rename files when they are placed in a specific directory

Is it possible to automatically rename a file when it's placed in a specific directory? For example I have a directory named "dir0".I move or copy a file named "file1" to "dir0".then "file1" should ...
13
votes
2answers
728 views

How secure is keeping non-root owned scripts in /etc/init.d?

I have an application which runs as a daemon and is controlled by a script in /etc/init.d Sometimes we need to change some parameters of startup/control of these scripts and then restart the daemon. ...
13
votes
4answers
8k views

What is the equivalent of Active Directory on Linux

I have a couple of machines at home (plus a number of Linux boxes running in VMs) and I am planning to use one of them as a centralized file server. Since I am more a Linux user rather than a ...
13
votes
5answers
8k views

How to find which process is regularly writing to disk?

How can I find which process is constantly writing to disk? I like my workstation to be close to silent and I just build a new system (P8B75-M + Core i5 3450s -- the 's' because it has a lower max ...
13
votes
4answers
445 views

How do I learn what I can do with /proc and /sys

I'd like to know more about the advanced uses of the /proc and /sys virtual filesystems, but I don't know where to begin. Can anyone suggest any good sources to learn from? Also, since I think sys has ...
13
votes
2answers
7k views

Get the chmod numerical value for a file

In FreeBSD and also in Linux, how can I get the numerical chmod value of a file? For example, 644 instead of -rw-r--r--? I need an automatic way for a Bash script.
13
votes
2answers
5k views

/proc/PID/fd/X link number

In Linux, in /proc/PID/fd/X, the links for file descriptors that are pipes or sockets have a number, like: l-wx------ 1 user user 64 Mar 24 00:05 1 -> pipe:[6839] l-wx------ 1 user user 64 Mar 24 ...
13
votes
1answer
223 views

Bash No Longer Changes Directory

My bash shell will no longer change directory with cd. I noticed it earlier when working and found that any new shells I opened (terminal or xterm etc) would be stuck in the home directory and could ...
13
votes
2answers
24k views

What is the difference between ioctl(), unlocked_ioctl() and compat_ioctl()?

Going through the linux 2.6.36 source code at lxr.linux.no, I could not find the ioctl() method in file_operations. Instead I found two new calls: unlocked_ioctl() and compat_ioctl(). What is the ...
13
votes
2answers
9k views

Reply on same interface as incoming?

I have a system with two interfaces. Both interfaces are connected to the internet. One of them is set as the default route; a side effect of this is that if a packet comes in on the non-default-route ...
13
votes
1answer
3k views

init process: ancestor of all processes?

I have always learned that the init process is the ancestor of all processes. Why does process 2 have a PPID of 0? $ ps -ef | head -n 3 UID PID PPID C STIME TTY TIME CMD root ...
13
votes
4answers
5k views

How to re-load all running applications from swap space into RAM?

If my desktop run out of memory and swaps a lot then I free or kill the application wasting my RAM. But, after that, all my desktop/applications have been swapped and are horribly slow, do you know a ...
13
votes
5answers
15k views

How to see disk details like manufacturer in Linux

With sfdisk -s I can see the disk capacity as follows: $ sfdisk -s /dev/cciss/c0d0: 143338560 total: 143338560 blocks How do I see disk details like disk manufacturer? I tried hdparm, but got an ...
13
votes
1answer
16k views

How to use command line to change volume?

I am trying to control the volume using my programming script. How can I do the following in Fedora 15, Ubuntu linux? Mute/ Unmute Volume up and volume down Note: Please note that I use a web USB ...
13
votes
4answers
91 views

Corruption-proof SD card filesystem for embedded Linux?

Recently we had a rather unpleasant situation with our customer - Raspberry Pi based "kiosk" used to display remote sensing data (nothing more fancy than a kiosk mode browser displaying a ...
13
votes
3answers
3k views

How to detect memory type under Linux?

Which Linux utility can tell me if I have registered or unbuffered ECC memory in my server? Lshw and dmidecode do not work for me; dmidecode provides no information about registered vs. unbuffered: ...
13
votes
3answers
4k views

Full disk encryption with password-less authentication in Linux

I have a fairly standard disk encryption setup in Debian 5.0.5: unencrypted /boot partition, and encrypted sdaX_crypt that contains all other partitions. Now, this is a headless server installation ...
13
votes
1answer
962 views

Shebang line with `#!/usr/bin/env command --argument` fails on Linux

I've got a simple script: #!/usr/bin/env ruby --verbose # script.rb puts "hi" On my OSX box, it runs fine: osx% ./script.rb hi However, on my linux box, it throws an error linux% ./script.rb ...
13
votes
2answers
590 views

How to detect if a disk is seeking?

I can use a variety of tools to measure the volume of disk I/O currently flowing through the system (such as iotop and iostat) but I'm curious if it's possible to easily detect if a disk is seeking a ...
13
votes
1answer
15k views

How can I set up logrotate to rotate logs hourly?

According the the Unix and Linux Administration Handbook and man, logrotate has options for daily, weekly, and monthly, but is there a way to add an hourly option? This blog post mentions you can set ...
13
votes
6answers
7k views

Correlating /var/log/* timestamps

/var/log/messages, /var/log/syslog, and some other log files use a timestamp which contains an absolute time, like Jan 13 14:13:10. /var/log/Xorg.0.log and /var/log/dmesg, as well as the output of $ ...
13
votes
2answers
5k views

Why does high disk I/O reduce system responsiveness/performance?

I never quite understood why high disk I/O slowed the system so much. It's strange to me because I would expect the slow-down to affect only those processes dependent on the hard/optical drive data, ...
13
votes
3answers
1k views

Given a git patch id, how to find out which kernel release contains it?

Assume I have some issue that was fixed by a recent patch to the official Linux git repository. I have a work around, but I’d like to undo it when a release happens that contains my the fix. I know ...
13
votes
6answers
1k views

Ideal Hardware for GNU/Linux Laptop

What's the best way to find a laptop with hardware that is amenable to installing and running GNU/Linux? I'm looking for something that will ideally work with GPL'd drivers and/or firmware. I took a ...
13
votes
1answer
320 views

Why is /dev full?

The /dev.. is full: SERVER:/dev # df -mP /dev Filesystem 1048576-blocks Used Available Capacity Mounted on udev 12042 12042 0 100% /dev There is no ...
13
votes
2answers
779 views

Why does Linux purge the memory cache when it is nearly full?

Here's what the memory graph looks like on a VPS running CentOS with 512MB of RAM and nginx/php-fpm/mysqld serving (mostly static) content to a couple thousand visitors per day. (those are days on ...
13
votes
5answers
248 views

Good website to link to for generic linux advocacy [closed]

I would like to have a link on website, both advertising the fact that I use (GNU/)linux, and pointing the curious reader to a source to learn more information. But I'm having trouble finding the ...
12
votes
7answers
12k views

Disable screen blanking on text console

I'm running linux clusters, mostly on SLES10. The servers are mostly blades, accessed via remote console. There is a real console in the server room, but switched off. I would like to disable the ...
12
votes
3answers
2k views

Why there are many BSD systems but only one Linux kernel?

Why there are many BSD systems but only one Linux kernel? I wonder why BSD was forked many times, but no such thing with Linux.
12
votes
4answers
5k 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 ...
12
votes
1answer
16k views

recursive mkdir

Is there a linux command that I'm overlooking that makes it possible to do something along the lines of: (pseudo) $ mkdir -R foo/bar/zoo/andsoforth Or is there no alternative but to make the ...
12
votes
3answers
13k views

Which users are allowed to log in via SSH by default?

When I set up my Debian 6, I was wondering, which users apart from root whose password I know can log into my system via SSH? When I install Apache 2 a user called www-data gets created. Does this ...
12
votes
3answers
571 views

Why do we need the reboot function in different binaries?

Why do we need the reboot function in different binaries? shutdown -r and reboot Or do they differ in something?
12
votes
4answers
1k views

Skills required for a good Linux job [closed]

I am working as an IT Engineer in a reputed company in India. The problem is that though I was told that I would be given work on Linux, I am made to do work on Java and Windows. I am uncomfortable ...
12
votes
3answers
955 views

Why would someone want to run UserMode Linux (UML)

The Linux README states that: Linux has also been ported to itself. You can now run the kernel as a userspace application - this is called UserMode Linux (UML). Why would someone want to do ...
12
votes
5answers
13k views

How to list all files in the size order

I would like to list all files in the order of big to small in size and the files could be present anywhere in a certain folder.
12
votes
3answers
10k views

Linux, disable /dev/fd0 (floppy)

Is it possible to make Linux kernel completely ignore the floppy disk controller? I do not have the drive but obviously my motherboard does contain the controller. I would like to disable the /dev/fd0 ...
12
votes
2answers
553 views

What happens if I use vi on large files?

Though we were instructed not to, a colleague of mine used vi to view a large text file (server.log 3.5 GB). This filled up /var/tmp and caused some problems on the server. What caused this? Why ...
12
votes
3answers
1k views

Wait command usage in Linux?

#!/bin/bash function back() { sleep $1 exit $2 } back $1 $2 & b=$! if `wait $!`;then echo success else echo failure fi bash-3.00# ./back 300 0 failure bash-3.00# ./back 300 1 ...
12
votes
2answers
3k views

Can I watch the progress of a `sync` operation?

I've copied a large file to a USB disk mounted on a Linux system with async. This returns to a command prompt relatively quickly, but when I type sync, of course, it all has to go to disk, and that ...
12
votes
1answer
6k 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?
12
votes
3answers
3k views

Understanding /dev and its subdirs and files

$ ls -l /dev/stdin /dev/fd/0 lrwx------ 1 tim tim 64 2011-08-07 09:53 /dev/fd/0 -> /dev/pts/2 lrwxrwxrwx 1 root root 15 2011-08-06 08:14 /dev/stdin -> /proc/self/fd/0 $ ls -l /dev/pts/2 ...
12
votes
2answers
10k views

What is the concept behind “tty” in linux?

Where did the terminology "tty" come from in Linux?
12
votes
5answers
2k views

Is btrfs stable enough for home usage? [closed]

btrfs has finally found its way into the latest kernels, is it considered stable and safe enough to use in a home backup scenario (as an alternative to zfs) ?
12
votes
3answers
23k views

Why the default eth0 interface is down by default on CentOS?

I am already a little bit familiar with Linux distros like Debian or Ubuntu (yeah, very similar) but I wanted to try Red Hat based - CentOS 6.2 . I have installed it on my Windows 7 host in virtualBox ...
12
votes
4answers
3k views

Please explain Linux boot sequence in detail

I am preparing a document in detail showing light on the boot sequence of Linux right from pressing of Power-on button the host to the login prompt appearance. It would be great if we could combine ...
12
votes
4answers
1k views

Best method to collect a random sample from a collection of files

Suppose there is a directory holding 300 data files. I want to randomly select 200 of those files and move them into another directory. Is there a way to do that under Unix/Linux?
12
votes
2answers
3k views

Why is Linux NFS server implemented in the kernel as opposed to userspace?

I was just wondering why the Linux NFS server is implemented in the kernel as opposed to a userspace application? I know a userspace NFS daemon exists, but it's not the standard method for providing ...
12
votes
1answer
698 views

Why does the file command say that ELF binaries are for Linux 2.6.9?

Whenever I run file on an ELF binary I get this output: [jonescb@localhost ~]$ file a.out a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked ...
12
votes
1answer
388 views

What happens when you rsync without a destination?

To make the story short, I did an rsync: rsync -avP root@exampleserver.com:/tmp/ And I forgot to put in my source directory... :( I really meant to run: rsync -avP /tmp/ ...