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

20
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 ...
20
votes
1answer
2k views

Why isn't a straightforward 1/5/15 minute moving average used in Linux load calculation?

Until recently i thought the load average (as shown for example in top) was a moving average on the n last values of the number of process in state "runnable" or "running". And n would have been ...
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
15k 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
3answers
14k 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?
19
votes
3answers
829 views

Which are the standard commands available in every Linux based distribution?

I would like to know which are the standard commands available in every Linux system. For example if you get a debian/ubuntu/redhat/suse/arch/slackware etc, you will always find there commands like: ...
19
votes
4answers
46k 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 ...
19
votes
3answers
5k views

How much RAM does the kernel use?

This question is motivated by my shock when I discovered that Mac OS X kernel uses 750MB of RAM. I have been using Linux for 20 years, and I always "knew" that the kernel RAM usage is dwarfed by X ...
19
votes
3answers
3k views

What does the vm.swappiness parameter really control?

Per the kernel documentation: This control is used to define how aggressive the kernel will swap memory pages. Higher values will increase aggressiveness, lower values decrease the amount of swap. ...
19
votes
2answers
17k views

Linux: How to find the device driver used for a device?

If my target has one device connected and many drivers for that device loaded, how can I understand what device is using which driver?
19
votes
4answers
3k views

What happens to the output of a process that has been disowned and lost its terminal?

If I close the virtual terminal, where some process was started, does the output just go straight to /dev/null, or can it pollute memory somehow? Can I anyhow grab the output to continue reading it at ...
19
votes
1answer
4k views

Why doesn't Linux use the IANA Ephemeral port range?

According to Wikipedia The Internet Assigned Numbers Authority (IANA) suggests the range 49152 to 65535 for dynamic or private ports. Many Linux kernels use the port range 32768 to 61000. Even ...
19
votes
4answers
19k views

How to record Skype video calls on Linux?

I'd like to conduct recorded video interviews with Skype and am looking for a reliable tool to accomplish that. Is there anything out there that's not slow or buggy? I'm running (K)Ubuntu.
18
votes
4answers
15k views

How to attach terminal to detached process?

I have detached a process from my terminal, like this: $ process & That terminal is now long closed, but process is still running and I want to send some commands to that process's stdin. Is ...
18
votes
4answers
9k 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 ...
18
votes
10answers
16k views

Linux replacement for Apple Keynote software?

Sorry for my ignorance, this is a newbie question: I am trying to migrate from Mac OS X to a Linux distribution, maybe/probably Ubuntu. One of my favorite applications for the Mac was Apple Keynote, ...
18
votes
5answers
22k 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.
18
votes
4answers
17k views

How is an Interrupt handled in Linux?

I just know that Interrupt is a hardware signal assertion caused in a processor pin. But I would like to know how Linux OS handles it. What all are the things that happen when an interrupt occurs?
18
votes
1answer
13k views

Getting information about a process' memory usage from /proc/pid/smaps

For a given process in /proc/<pid>/smaps, for a given mapping entry what are: Shared_Clean Shared_Dirty Private_Clean Private_Dirty Is Shared_Clean + Shared_Dirty the amount of memory that ...
18
votes
3answers
5k views

Why does the 'bin' user need a login shell?

During an audit of /var/log/auth.log on one of my public webservers, I found this: Jan 10 03:38:11 Bucksnort sshd[3571]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 ...
18
votes
3answers
15k views

What is the most high-performance Linux filesystem for storing a lot of small files (HDD, not SSD)?

I have a directory tree that contains many small files, and a small number of larger files. The average size of a file is about 1 kilobyte. There are 210158 files and directories in the tree (this ...
18
votes
3answers
11k views

What are pseudo terminals (pty/tty)?

This might be really basic question but I want to understand it thoroughly. What is a pseudo terminal? (tty/pty) Why do we need them? How they got introduced and what was the need for it? Are they ...
18
votes
1answer
2k views

Run a command for a specified time and then abort if time exceeds

I want know how I can run a command for a specified time say, one minute and if it doesn't complete execution then I should be able to stop it.
18
votes
6answers
1k views

Is there a way to limit overall CPU consumption?

My laptop (an HP with an i3 chip) overheats like crazy every time I run a resource heavy process (like a large compilation, extracting large tarballs or ... playing Flash). I am currently looking ...
18
votes
6answers
4k views

What's the most “correct” mount point for a permanent NTFS partition?

I have an NTFS partition (containing a Windows installation from which I dual boot) that I would like to permanently mount from my Linux installation. Problem is, I can't figure out what the ...
18
votes
2answers
36k views

How to recover a crashed Linux md RAID5 array?

Some time ago I had a RAID5 system at home. One of the 4 disks failed but after removing and putting it back it seemed to be OK so I started a resync. When it finished I realized, to my horror, that 3 ...
18
votes
2answers
12k views

how to check rx ring, max_backlog, and max_syn_backlog size

Quite often in the course of troubleshooting and tuning things I find myself thinking about the following Linux kernel settings: net.core.netdev_max_backlog net.ipv4.tcp_max_syn_backlog ...
17
votes
5answers
30k 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, ...
17
votes
4answers
29k views

linux: How can I view all UUIDs for all available disks on my system?

My /etc/fstab contains this: # / was on /dev/sda1 during installation UUID=77d8da74-a690-481a-86d5-9beab5a8e842 / ext4 errors=remount-ro 0 1 There are several other disks on ...
17
votes
4answers
2k views

How Does Linux deal with shell scripts?

For this question, let's consider a bash shell script, though this question must be applicable to all types of shell script. When someone executes a shell script, does Linux load all the script at ...
17
votes
8answers
2k views

The most universal scripting language for Linux is?

We are writing scripts for Linux systems, there has been some debate over what would be the most universally Linux present scripting language to use. Bash, SH, Posix? What?
17
votes
3answers
2k views

Standard and/or common directories on Unix/Linux OSes

Coming from the Windows world, I have found the majority of the folder directory names to be quite intuitive: \Program Files contains files used by programs (surprise!) \Program Files (x86) contains ...
17
votes
3answers
4k views

Why does dd from /dev/random give different file sizes?

I am running the following command on an ubuntu system: dd if=/dev/random of=rand bs=1K count=2 However, every time I run it, I end up with a file of a different size. Why is this? How can I ...
17
votes
3answers
4k views

When should I use a trailing slash on a directory? [duplicate]

Possible Duplicate: How linux handles multiple path separators (/home////username///file) Most commands I use in linux behave exactly the same whether I include the trailing slash / ...
17
votes
4answers
1k views

Why does Linux scale so well to different hardware platforms?

Why does Linux run well on so many different types of machines - desktops, laptops, servers, embedded devices, mobile phones, etc? Is it mainly because the system is open, so any part of it can be ...
17
votes
4answers
18k views

What is a spinlock in Linux?

I would like to know about spinlocks in detail? Could someone explain that to me?
17
votes
2answers
936 views

Why does `kill -l` not list signal numbers of 32 and 33?

Executing kill -l on linux gives: 1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP 6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1 11) SIGSEGV ...
17
votes
1answer
22k views

How is a message queue implemented in the Linux kernel?

I would like to know how Message Queues are implemented in the Linux Kernel.
17
votes
6answers
19k views

Linux: allowing an user to listen to a port below 1024

I need to allow an user (different from root) to run a server listening on port 80. Is there any way to do this?
17
votes
4answers
8k views

Resume transfer of a single file by rsync

In Ubuntu, I want to copy a big file from my hard drive to a removable drive by rsync. For some other reason, the operation cannot complete in a single run. So I am trying to figure out how to use ...
17
votes
2answers
10k views

Why is swappiness set to 60 by default?

I just read some stuff about swappiness on Linux. I don't understand why the default is set to 60. According to me this parameter should be set to 10 in order to reduce swap. Swap is on my hard ...
17
votes
7answers
5k views

Linux equivalent to ReadyBoost?

Is there a kernel module or some other patch or something similar to Windows' ReadyBoost? Basically I'm looking for something that allows disk reads to be cached on a Flash drive.
17
votes
1answer
8k views

What is difference between User space and Kernel space?

Is Kernel space used when Kernel is executing on the behalf of the user program i.e. System Call? Or is it the address space for all the Kernel threads (for example scheduler)? If it is the first ...
17
votes
2answers
61k views

How to get the complete and exact list of mounted filesystems in Linux?

I usually use mount to check which filesystems are mounted. I also know there is some connection between mount and /etc/mtab but I'm not sure about the details. After reading How to check if /proc/ is ...
17
votes
2answers
3k views

How to blacklist a correct bad RAM sector according to MemTest86+ error indication?

MemTest86+ (the version included with Ubuntu 13.04) says Failing address: 002f796c48 - 759.5 MB What should I specify in the memmap kernel parameter to bypass this area? I've tried running ...
17
votes
2answers
3k views

How does sudo remember you already entered root's password?

When using sudo on Linux, it asks for root password, but only the first time you run it. If you run another sudo command, it remember you already entered the password previously and doesn't ask for ...
17
votes
2answers
38k views

How can I change a user's default group in Linux?

Being new to Linux administration, I'm a little confused about the following commands: useradd usermod groupadd groupmod I've just finished reading the user administration book in the Linux/Unix ...
17
votes
3answers
206 views

Can I achieve functionality similar to interrupts in Linux userspace?

One of functionalities I miss the most from "small embedded" in Embedded Linux is the interrupts. A signal appears on a specific pin, or other interrupt source is triggered and whatever was done ...
16
votes
4answers
16k views

How do I make multiple directories at once in a directory?

I know with mkdir I can do mkdir A B C D E F to create each directory. How do I create directories A-Z or 1-100 with out typing in each letter or number?
16
votes
3answers
759 views

How much does the Linux kernel change in one year?

How can I get statistics about how much (in percents) the Linux kernel source code changes in one year?