Linux is the generic term for a UNIX-like open source operating system based on the Linux kernel.

learn more… | top users | synonyms (1)

30
votes
3answers
16k views

What is the difference between unlink and rm?

Is unlink any faster than rm?
30
votes
6answers
28k views

How do I list loaded Linux module parameter values?

Is there a standard way to list the parameter values of a loaded Linux module? I'm essentially probing for another answer to this Linux kernel module parameters question, because the module I'm ...
30
votes
3answers
18k views

Tuning Linux IP routing parameters — secret_interval and tcp_mem

We had a little failover problem with one of our HAProxy VMs today. When we dug into it, we found this: Jan 26 07:41:45 haproxy2 kernel: [226818.070059] __ratelimit: 10 callbacks suppressed Jan 26 ...
30
votes
6answers
23k views

swap partition vs file for performance?

What is better for performance? A partition closer to the inside of the disk will have slower access times, and we must wait for the drive to switch between the OS and swap partitions. On the other ...
29
votes
7answers
147k views

How to check the physical status of an ethernet port in Linux?

I want to check if a specified ethX is physically up or down. How do I do that with the command line?
29
votes
9answers
37k views

Disk full, du tells different. How to further investigate?

I have a SCSI disk in a server (hardware Raid 1), 32G, ext3 filesytem. df tells me that the disk is 100% full. If I delete 1G this is correctly shown. However, if I run a du -h -x / then du tells me ...
29
votes
7answers
54k views

How to get e-mail from (failed) cron-jobs in Ubuntu?

I create cron-jobs in Ubuntu by placing the executable in one of /etc/cron.{daily,hourly,monthly,weekly}. There are lots of directories starting with cron: kent@rat:~$ ls -ld /etc/cron* drwxr-xr-x 2 ...
29
votes
4answers
177k views

Check if port is open or closed on a Linux server?

How can I check if a port is open or closed on a Linux server?
29
votes
5answers
26k views

What is “-bash: !”: event not found"

Try executing the following under a bash shell echo "Reboot your instance!" On my installation: root@domU-12-31-39-04-11-83:/usr/local/bin# bash --version GNU bash, version 4.1.5(1)-release ...
29
votes
6answers
35k views

shutdown: What is difference between “Power Off” and “Halt”?

With your typical Linux shutdown command, what is the difference between halting the system and powering off the system?
29
votes
7answers
27k views

Amazon Linux vs. Ubuntu for Amazon EC2 [closed]

I'm setting up my first website on Amazon EC2, and I'm trying to decide which distro to use. I've used Redhat and CentOS in the past, but I have no bias towards any system, I just want to use whatever ...
29
votes
6answers
13k views

How to determine the “age” of a linux system since installation?

I thought that I could easily check the timestamp of particular files. Then I realized that it wouldn't be so easy when I saw timestamps like 1991.
29
votes
5answers
3k views

How can a Linux Administrator improve their shell scripting and automation skills?

In my organization, I work with a group of NOC staff, budding junior engineers and a handful of senior engineers; all with a focus on Linux. One interesting step in the way the company grows talent is ...
29
votes
3answers
25k views

iptables port redirect not working for localhost

I want to redirect all traffic from port 443 to the internal port 8080. I'm using this config for iptables: iptables -t nat -I PREROUTING --source 0/0 --destination 0/0 -p tcp \ --dport 443 ...
29
votes
5answers
3k views

Linux hardening - web servers

What are your checklist/routine when setting up a Linux web server? What do you recommend to achieve maximum security? Is there any preferred way to perform repeated maintenance?
29
votes
5answers
15k views

How useful is mounting /tmp noexec?

Many people (including the Securing Debian Manual) recommend mounting /tmp with the noexec,nodev,nosuid set of options. This is generally presented as one element of a 'defense-in-depth' strategy, by ...
29
votes
5answers
39k views

How passively monitor for tcp packet loss? (Linux)

How can I passively monitor the packet loss on TCP connections to/from my machine? Basically, I'd like a tool that sits in the background and watches TCP ack/nak/re-transmits to generate a report on ...
29
votes
1answer
1k views

Is it possible to influence the way CPUs are enumerated under Linux?

I have a HP DL380 G7 with 2 mismatched CPUs in it. One is a quad core CPU with faster cores, and one is a 6 core CPU with slower cores. On this box I run an application that due to licensing reasons ...
29
votes
8answers
3k views

Securing PHP webservers

PHP applications have a reputation for higher than average security problems. What configuration techniques do you use for making sure the application is secure as possible? I'm looking for ideas ...
29
votes
4answers
6k views

Does anyone really understand how HFSC scheduling in Linux/BSD works?

I read the original SIGCOMM '97 PostScript paper about HFSC, it is very technically, but I understand the basic concept. Instead of giving a linear service curve (as with pretty much every other ...
28
votes
9answers
5k views

Multiple Linux sysadmins working as root

In our team we have three seasoned Linux sysadmins having to administer a few dozen Debian servers. Previously we have all worked as root using SSH public key authentication. But we had a discussion ...
28
votes
3answers
19k views

Turn off the Linux OOM killer by default?

The OOM killer on Linux wreaks havoc with various applications every so often, and it appears that not much is really done on the kernel development side to improve this. Would it not be better, as a ...
28
votes
5answers
70k views

How to install/change locale on Debian?

I've written a web application for which the user interface is in Dutch. I use the system's date and time routines to format date strings in the application. However, the date strings that the system ...
28
votes
4answers
26k views

How to sort ps output by process start time?

Is there a way to sort ps output by process start time, so newest are either at the top or bottom ? On Linux ? On SysV5 ? On Mac ?
28
votes
4answers
2k views

Where is the statement of deprecation of ifconfig (on linux)?

A lot of people is stating that the ifconfig command is deprecated in favor of the ipone (on linux at least). This is often used as an argumentation to switch from ifconfig to ip (see some comment ...
28
votes
7answers
31k views

Linux: how to restore config file using apt-get/aptitude?

I've occasionally lost my config file "/etc/mysql/my.cnf", and want to restore it. The file belongs to package mysql-common which is needed for some vital functionality so I can't just purge ...
28
votes
2answers
16k views

Damaged /vmlinuz and /initrd.img symbolic links after Kernel uninstall

OS: Ubuntu 8.04 LTS Server Edition We just rolled back an kernel update using the following command: sudo apt-get remove linux-image-2.6.24-24-server The uninstallation was successful, but it had ...
27
votes
3answers
2k views

Did a cat /dev/urandom - Broken terminal

Out of curiosity, when your shell character set breaks from doing something like cat /dev/urandom is there a way to fix that in place?
27
votes
5answers
3k views

Linux server out of space

I have been asked this question in two consecutive interviews, but after some research and checking with various systems administrators I haven't received a good answer. I am wondering if somebody can ...
27
votes
3answers
35k views

EPEL Repo for CentOS 6 causing error

I've got a VM running CentOS 6 (64bit) and I'm attempting to add the EPEL repo like usual to install various packages as I do quite regularly. Today, I'm experiencing some strange errors yet I'm ...
27
votes
14answers
13k views

File Server - Storage configuration: RAID vs LVM vs ZFS something else…?

We are a small company that does video editing, among other things, and need a place to keep backup copies of large media files and make it easy to share them. I've got a box set up with Ubuntu ...
27
votes
7answers
5k views

Reasons to disable / enable SELinux

In the line of this question on StackOverflow and the completely different crowd we have here, I wonder: what are your reasons to disable SELinux (assuming most people still do)? Would you like to ...
27
votes
4answers
4k views

Why Swap is used when plenty of free memory is left?

I have pretty good web (dedicated) server with good memory resource System information Server load 2.19 (8 CPUs) Memory Used 29.53% (4,804,144 of 16,267,652) Swap Used 10.52% ...
27
votes
8answers
37k views

How to add a timestamp to bash script log?

I have a constantly running script that I output to a log file: script.sh >> /var/log/logfile I'd like to add a timestamp before each line that is appended to the log. Like: Sat Sep 10 ...
27
votes
8answers
6k views

How do you setup ssh to authenticate using keys instead of a username / password?

How do you setup ssh to authenticate a user using keys instead of a username / password?
27
votes
6answers
25k views

What happens if I delete lost+found

When you create some Linux filesystems like ext3 a 'lost+found' directory is created. According to this files will be placed there if files were damaged from some kind of system crash. What happens ...
27
votes
6answers
1k views

Top-like tool for IP traffic [closed]

I need to keep watch on how much bandwidth some connections are taking in a server, and I know I have seen a top-like tool for that before. However, I can't remember the name of the tool, and I'm not ...
27
votes
8answers
22k views

Why rsync is faster than NFS?

Few days ago I noticed something rather odd (at least for me). I ran rsync copying the same data and deleting it afterwards to NFS mount, called /nfs_mount/TEST. This /nfs_mount/TEST is ...
27
votes
1answer
2k views

Why does deleting a big file take longer?

My understanding is that running rm on a file simply unlinks it, marking the space as free in the filesystem. It should then follow that deleting one file always takes roughly the same amount of time ...
27
votes
2answers
793 views

Why is it bad to have root writing files to a directory not owned by root?

This came up in a comment to another question and I'd love it if someone could explain the reasons for this to me. I suggested having Apache log the errors for a given VHost to a user's home ...
26
votes
14answers
14k views

How do I find out what version of Linux is running?

Sometimes your scripts need to behave differently on different Linux's. How can I determine which version of Linux a script is running on?
26
votes
9answers
10k views

How to hide a password passed as command line argument?

I'm running a software daemon that requires for certain actions to enter a passphrase to unlock some features which looks for example like that: $ darkcoind masternode start <mypassphrase> ...
26
votes
3answers
14k views

How to get TX/RX bytes without ifconfig?

Since ifconfig is apparently being deprecated in major Linux distributions, I thought I'd learn something about the ip tool that's supposed to be used instead of ifconfig. And here I ran into a ...
26
votes
3answers
20k views

Linux - How can I see what's waiting for disk IO

I have a server that has a really high load. Nothing is jumping out at me in terms of CPU usage, and it's not swapping. I think it's cause some processes are waiting for disk IO, and I want to see ...
26
votes
3answers
60k views

How can I allow one user to su to another without allowing root access?

I'd like to allow certain users to su to another user account without having to know that account's password, but not allow access to any other user account (i.e. root). For instance, I'd like to ...
26
votes
7answers
23k views

Unzipping files that are flying in through a pipe

Can I make unzip or any similar programs work on the standard output? The situation is I'm downloading a zip file, which is supposed to be unzipped on the fly. Related issue: ...
26
votes
4answers
38k views

Linux/Windows/Unix/… file names: Which characters are allowed? Which are unescaped?

Which characters are allowed and which of them must be escaped on the command line in different operating systems?
26
votes
2answers
16k views

Force dig to resolve without using cache

I'm wondering if there is a way to query a DNS server and bypass caching (with dig). Often I change a zone on the DNS server and I want to check if it resolves correctly from my workstation. But since ...
26
votes
4answers
20k views

How to disconnect from lxc-console

I'm working with lxc in Ubuntu 12.04, and it's really great. However, I am unable to disconnect from a lxc-console session after I've connected. I read somewhere that Ctrl-aq will disconnect me from ...
26
votes
1answer
14k views

How do I access the attached volume in Amazon EC2

I just attached another ebs volume to running instance. But how do I access the volume? I can't find the /dev/sda directory anywhere. Where should I look?