Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs.

learn more… | top users | synonyms

23
votes
3answers
2k views

Why is Linux reporting “free” memory strangely?

This is a canonical question about how Unix operating systems report memory usage. Similar Questions: Server refuses to use swap partition Memory Usage in LINUX I have production ...
18
votes
23answers
28k views

Finding the Public IP address in a shell script

I can find my IP address using ifconfig or hostname -i command. But how do I find my Public IP? (I have a static public IP but I want to find it out using unix command)
160
votes
11answers
49k views

Can I nohup/screen an already-started process?

I'm doing some test-runs of long-running data migration scripts, over SSH. Let's say I start running a script around 4 PM; now, 6 PM rolls around, and I'm cursing myself for not doing this all in ...
24
votes
6answers
7k views

Meaning of directories on Unix and Unix like systems

I've been using Linux for a couple of years now but I still haven't figured out what the origin or meaning of some the directory names are on Unix and Unix like systems. E.g. what does etc stand for ...
14
votes
8answers
3k views

How many and which partitions should I create for a linux server?

Partitions are very important on Linux server because it give you a lot of flexibility, for example when upgrading to a bigger hard drive. But, how many partitions should I create when building a ...
12
votes
1answer
350 views

Can you help me with my software dependency issue?

This is a Canonical Question about Compile Dependencies and Package Management. I have a question regarding compiling ports/software or installing RPMs on my *nix server. When I try to do this ...
55
votes
6answers
65k views

How to forcibly close a socket in TIME_WAIT?

I run a particular program on linux which sometimes crashes. If you open it quickly after that, it listens on socket 49201 instead of 49200 as it did the first time. netstat reveals that 49200 is in ...
2
votes
8answers
725 views

How to run a cron job?

I have a sample perl script which i need to run using cron daily ,could any one let me know the exact syntax to use cron job. Thanks in advance.
26
votes
9answers
25k views

How to reduce memory usage on a Unix webserver

I'm currently using a Joyent Accelerator to host my webapps, and it's working fine, however I need to reduce costs so I'm downgrading my current plan and that imposes some new memory limits (256M rss, ...
48
votes
8answers
27k views

Environment variables of a running process on Unix?

This is to troubleshoot some problems related to environment variables .. On Windows, I could do this by using tool such as ProcessExplorer to select particular process and view values of each ...
13
votes
4answers
2k views

Log transport and aggregation at scale

How're you analysing log files from UNIX/Linux machines? We run several hundred servers which all generate their own log files, either directly or through syslog. I'm looking for a decent solution to ...
9
votes
2answers
5k views

Better logging for cronjobs? Send cron output to syslog?

I am looking for a better way to log cronjobs. Most cronjobs tend to spam email or the console, get ignored, or create yet another logfile. In this case, I have a Nagios NSCA script which sends data ...
35
votes
2answers
4k views

Why do I have to edit /etc/sudoers with visudo?

I've noticed that the sudoers file and cron config files act in a special way compared to other config files on Linux. They need to be edited with a special wrapper rather than any text editor. Why is ...
6
votes
2answers
5k views

Is it possible to limit a Linux process so that it can only run on a particular core on a particular machine?

Let's say I have a quad-core box and four identical processes, each with ten threads. Is it possible, in Linux, to say that Process A is only allowed to run on CPU 0, Process B is only allowed to run ...
6
votes
3answers
2k views

Is SSH logging capabilities equivalent to su logging for private/public key authentication?

Here at work, we have a non-root shared login account on UNIX that is used to admin a particular application. The policy is to not allow direct logins to the shared account; you must login as yourself ...
4
votes
1answer
1k views

Mounting windows shares with Active Directory permissions

I've managed to get my Ubuntu (server 10.04 beta 2) box to accept logins from users with Active Directory credentials, now I'd like those users to access their permissible windows shares on a W2003 R2 ...
5
votes
3answers
320 views

Is SPF enough to make sure emails get delivered to inbox?

So I just succesfully set up postfix + dovecot. is SPF enough to make sure emails get delivered to my website's users? I don't want my emails to end up in their spam box.
3
votes
3answers
4k views

What's the purpose of setgid directory?

I know how setgid works, but I don't know why it is designed, is there any example to illustrate what problems it solves?
99
votes
3answers
33k views

What is the difference between double and single square brackets in bash?

I just wondered what exactly the difference between [[ $STRING != foo ]] and [ $STRING != foo ] is, apart from that the latter is posix-compliant, found in sh and the former is an extension ...
29
votes
8answers
21k views

What is a zombie process and how do I kill it?

Virtual Shotguns?
27
votes
4answers
22k views

How to convert text file from Windows line breaks to Unix ones on Unix/Linux?

Is there a quick way to convert text file from Unix line breaks to Windows ones in Unix environment? I thought there could be a standard utility.
19
votes
5answers
2k views

Turning off atime on a filesystem

I am setting up a mongoDB replica set and one of the first things I am suppose to do is turn off atime on the file system. After researching this a bit, I am not opposed to doing this, but I have to ...
13
votes
2answers
6k views

Unix socket vs TCP/IP host:port

Could someone please describe to me the pros and cons of using a Unix socket file vs a tcp/ip localhost:port when setting up services on a server (Ubuntu, FWIW)? In this particular instance it's for ...
13
votes
9answers
1k views

Is there a paging version of `watch`?

Under a UNIX shell, how can I get a similar effect to the watch command, but with paging so that I can scroll around in the output if it takes up more than one screen? In other words, I want a ...
6
votes
9answers
6k views

Easiest way to email file via command line in *nix?

What is the easiest - and preferably most portable - command I can use to email a single file as an attachment a *nix shell?
5
votes
5answers
2k views

What's the best way of setting up a cron job to check that a long-running process is still going and if not, start it?

As per the title: What's the best way of setting up a cron job to check that a long-running process is still going and if not, start it? If I start a long-running process in cron, is it going to ...
3
votes
7answers
629 views

Identifying changed files on *nix webserver

Looking for some (*nix) software which will build an index of "interesting" files on a server and notify when certain of those files contents are modified, or new files appear. Similar to rkhunter et ...
1
vote
3answers
1k views

I am on Rackspace Cloud. What is Bandwidth Out and Bandwidth In?

Can someone give me very easy to understand examples? And how to calculate? Suppose someone views a page off of my web server. This page is 400kb. How much is the bandwidth in and out for me?
17
votes
7answers
18k views

Why can't you fsck a mounted partition?

It's well-known that you should never fsck a mounted partition. I can understand how this could easily lead to corruption if the filesystem is written to by fsck (e.g., the -a option is used), but why ...
6
votes
2answers
3k views

Create Unix Named Socket from the Command Line

Is there a command similar to mkfifo but for domain sockets?
5
votes
3answers
3k views

Directory that a user can read, but root can't?

There's a directory underneath my homedir called ".gvfs". As my regular user account, I can read it just fine: ~ $ ls -lart ~raldi/.gvfs total 4 dr-x------ 2 raldi raldi 0 2009-05-25 22:17 . ...
5
votes
3answers
168 views

How to stay up to date with the latest information about UNIX software patches and upgrades?

Until now I have always used the SecurityFocus mailing lists to keep myself informed about the possible need of upgrading my server packages. The main problems I have with using this method: Massive ...
4
votes
4answers
7k views

In unix, what's the best way to reduce the size of a massive log file that is actively being written to?

On a linux server, I want to reduce the size of a log file which is several GB big. Cutting off the top half, or maybe the first million lines would work.
0
votes
1answer
382 views

Managing SSH keys for multiple users for multiple systems (ie github like ssh key ui)

So we are trying to lock down our systems to be accessed only by a few logical users (users on the Linux machines) but many physical users. That is all the developers can login as user dev with their ...
3
votes
5answers
1k views

Inventory or Audit Installed Linux Software

I am working on a project where we need to be able to tell and report periodically on what software is installed on our various Linux/Unix servers. I have looked at this, How to inventory what ...
3
votes
3answers
5k views

Apache executes HTML, but not PHP; PHP CLI works

I am running php 5.3.3 on rhel 6.2 with Apache 2.2.15 and am failing to get PHP code interpreted by Apache. There are no errors (in the system log, httpd/error_log, or php_errors.log) - I have ...
3
votes
1answer
12k views

Apache: Configure “LogLevel debug” for certain modules only?

I want to debug some authentication & authorization issues on my webserver, particularly with mod_authnz_ldap and other mod_auth* modules. So I set LogLevel debug in the Apache configuration, ...
2
votes
2answers
2k views

Monitoring /proc/sys/fs/inode-nr

As part of a general overhaul of some Nagios scripts, I am adding parameters to the scripts so that the thresholds can be determined on a machine-by-machine basis. As an example, we are specifying ...
1
vote
1answer
2k views

Weblogic administration console way too slow

I've installed weblogic 10.3.3, configured simple domain with default configuration. And after starting weblogic I cannot use it via admin console because it is starting too slow (~10 mins). It seems ...
1
vote
2answers
154 views

How can you see the processes which you put to background?

This question is based on this thread. How can you see the processes which you put to background?
0
votes
1answer
159 views

command to edit /tcb/files/auth/s/someuser

is there a command in HP Unix used to change for example min age for password in this file without actually editing the file? /tcb/files/auth/s/someuser it has to do with trusted or non-trusted ...
0
votes
2answers
2k views

Apache, virtual hosts, and default sender for sendmail

So here's my issue...I have two sites hosted on one machine using apache's virtual hosts. I want to send emails from the two different sites (domain.com and domain2.com) using the appropriate email ...
33
votes
42answers
6k views

Tools a Unix administrator cannot live without [closed]

After administering Unix or Unix-like servers, what tools (command-line preferably) do you feel you cannot live without?
72
votes
15answers
72k views

Copying a large directory tree locally? cp or rsync?

I have to copy a large directory tree, about 1.8 TB. It's all local. Out of habit I'd use rsync, however I wonder if there's much point, and if I should rather use cp. I'm worried about permissions ...
35
votes
52answers
5k views

Favorite Unix command line aliases? [closed]

What are your favorite command line aliases (bash/sh/tcsh) aliases? Here are a few of mine. alias lsr='ls -lrt' alias gon='cd $HOME/Notes' alias devdb='mysql -h dev --user=x --password=secret ...
34
votes
30answers
5k views

Command line safety tricks [closed]

Command line and scripting is dangerous. Make a little typo with rm -rf and you are in a world of hurt. Confuse prod with stage in the name of the database while running an import script and you are ...
49
votes
9answers
35k views

Is it possible to detach a process from its terminal? (Or, “I should have used screen!”) [duplicate]

Possible Duplicate: Can I nohup/screen an already-started process? On Unix (specifically, Linux), I've started a job in a regular ssh->bash session. I'd like to leave work soon, but I now ...
39
votes
1answer
18k views

How do I change my private key passphrase?

I have an existing public/private key pair, the private key is password protected, the encryption may be either RSA or DSA. These keys are the kind you generate with ssh-keygen and generally store ...
44
votes
3answers
5k views

What is the difference between a soft (symbolic) link and a hard link?

I hear that you can now create soft links in Vista too. So, what is the difference between a soft (symbolic) link and a hard link on UNIX/Linux/Vista? Are there advantages of using one over the ...
28
votes
11answers
955 views

Best practices for keeping UNIX packages up to date?

How do you keep your servers up to date? When using a package manager like Aptitude, do you keep an upgrade / install history, and if so, how do you do it? When installing or upgrading packages on ...