Questions tagged [unix]

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

Filter by
Sorted by
Tagged with
45 votes
3 answers
10k 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 ...
user avatar
284 votes
13 answers
100k 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 ...
ojrac's user avatar
  • 2,943
44 votes
23 answers
71k 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)
shantanuo's user avatar
  • 3,619
147 votes
7 answers
58k 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 ...
Luke's user avatar
  • 3,856
132 votes
8 answers
321k 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 ...
Rehan's user avatar
  • 1,423
36 votes
8 answers
46k 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, ...
lima's user avatar
  • 806
15 votes
8 answers
6k 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 ...
paulgreg's user avatar
  • 4,164
1 vote
1 answer
1k views

Email server configuration still complaining the connection isn't secure

This is a follow up to another question I had, but its quite different so I thought I'd start a new post. Emails bouncing - 454 TLS not available due to temporary reason I'm trying to work out why I ...
Andrew Newby's user avatar
  • 1,184
421 votes
3 answers
352k views

How do I change my private key passphrase?

I have an existing public/private key pair. The private key is password protected, and the encryption may be either RSA or DSA. These keys are the kind you generate with ssh-keygen and generally store ...
kch's user avatar
  • 4,682
190 votes
6 answers
499k views

SSL Certificate Location on UNIX/Linux

Is there any standard or convention for where SSL certificates and associated private keys should go on the UNIX/Linux filesystem?
John Topley's user avatar
  • 2,205
123 votes
8 answers
279k views

How to get pid of just started process

I want to start process (eg. myCommand) and get its pid (to allow to kill it later). I tried ps and filter by name, but I can not distinguish process by names myCommand ps ux | awk '/<myCommand&...
rafalmag's user avatar
  • 1,341
70 votes
3 answers
57k 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 ...
Stefan Lasiewski's user avatar
14 votes
2 answers
20k 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?
Lenik's user avatar
  • 812
245 votes
13 answers
155k views

Environment variables of a running process on Unix?

I need to troubleshoot some problems related to environment variables on a Unix system. On Windows, I can use a tool such as ProcessExplorer to select particular a process and view values of each ...
Gant's user avatar
  • 2,595
176 votes
9 answers
222k 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 realize ...
mike's user avatar
  • 4,013
54 votes
2 answers
10k 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 ...
Brian Lyttle's user avatar
  • 1,757
54 votes
3 answers
31k 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 ...
Ludo's user avatar
  • 1,099
19 votes
2 answers
13k views

Why does chmod(1) on the group affect the ACL mask?

I am trying to understand this Unix behavior (which I happen to be testing on Ubuntu 11.10): $ touch foo $ setfacl -m u:nobody:rwx foo $ getfacl foo # file: foo # owner: michael # group: michael user:...
Michael Kropat's user avatar
19 votes
1 answer
61k 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, ...
Stefan Lasiewski's user avatar
13 votes
1 answer
524 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 I ...
dunxd's user avatar
  • 9,714
10 votes
2 answers
14k 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 ...
mike's user avatar
  • 4,013
9 votes
10 answers
6k views

Useful Commandline Commands on Unix

As there is a windows version of this question, I decided to open a community wiki for the same question under unix, linux, and the like. I'll be updating this list with the answers: bash: exec 3&...
4 votes
1 answer
5k 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 ...
Jamie's user avatar
  • 1,314
2 votes
1 answer
2k views

How to read HUGE clientmqueue in human format?

Clientmqueue is over 18GB and ls /var/spool/clientmqueue is working 5 min already. I want to see what mail is in the queue. Maybe i can read some in human format? To see date title who send it and ...
barraba's user avatar
  • 35
2 votes
8 answers
2k 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.
user avatar
233 votes
19 answers
296k views

In my /etc/hosts/ file on Linux/OSX, how do I do a wildcard subdomain?

I need to test sub-domains on my localhost. How can I effectively have this result of adding *.localhost.com to my /etc/hosts/ file? If it's not possible, how do I work around this problem? I need ...
MikeN's user avatar
  • 8,502
229 votes
8 answers
270k views

When does /tmp get cleared?

I'm taking to putting various files in /tmp, and I wondered about the rules on deleting them? I'm imagining it's different for different distributions, and I'm particularly interested in Ubuntu and ...
John Lawrence Aspden's user avatar
70 votes
4 answers
68k views

What is the "slash" after the IP? [duplicate]

In Amazon EC2, where I set "security groups", It says: Source: 0.0.0.0/0 And then it gives an example of: 192.168.2.0/24 What is "/24"? I know what port and IP is.
Alex's user avatar
  • 8,591
67 votes
4 answers
36k views

Drawbacks of mounting a filesystem with noatime?

Having every file be updated just when accessing them sounds like a waste. What's the catch with mounting a file system with the noatime option. What kind of applications/servers relies on the access ...
nos's user avatar
  • 2,468
56 votes
5 answers
98k views

Create Unix Named Socket from the Command Line

Is there a command similar to mkfifo but for domain sockets?
benmmurphy's user avatar
44 votes
7 answers
52k 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 ...
mike's user avatar
  • 4,013
40 votes
7 answers
44k views

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

Virtual Shotguns?
jldugger's user avatar
  • 14.5k
37 votes
10 answers
75k views

Is it feasible to have home folder hosted with NFS?

I'm planning to deploy some kiosk computers and would like to leave them with a small pendrive as boot disk, keeping the rest at an easy to back up server, ala LTSP. Right now I'm pondering two ...
voyager's user avatar
  • 728
33 votes
5 answers
41k views

How to convert line breaks in a text file between the Windows and Unix/Linux formats?

How do I convert line breaks in a text file between the Windows and Unix/Linux formats? I have a *nix environment, but that I need to import and export data with the Windows-style line breaks. I ...
alexeit's user avatar
  • 906
31 votes
5 answers
8k 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 ...
QWade's user avatar
  • 927
30 votes
13 answers
11k 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 ...
David Dean's user avatar
29 votes
10 answers
14k views

I just did a chmod -x chmod

So I did a chmod -x chmod. How I can fix this problem? How do I give execute rights back to chmod?
Rook's user avatar
  • 2,695
23 votes
4 answers
21k views

Does iowait include time waiting for network calls?

The proc(5) manpage describes iowait as "time waiting for IO to complete". This was mostly explained in an earlier question. My question is: while waiting in blocking IO, does this include waiting on ...
Alex J's user avatar
  • 2,844
23 votes
4 answers
19k views

dmesg time vs system time time isn't correct

I hope that here is somebody that can help me with this strange problem. I think that i know why it is happening but i don't know how to solve it. Maybe it is because the BIOS time isn't set correct ...
g00gle's user avatar
  • 373
23 votes
2 answers
19k views

What is the sticky bit in UNIX file systems? When is it used?

What is the sticky bit in a UNIX file system? As an admin when and how would you use it?
Aaron K's user avatar
  • 1,525
15 votes
4 answers
21k views

After deleting a large file, how long does it take `df` to pick up the change?

I deleted a 2.3GB log file on my Ubuntu server, and df doesn't seem to be picking up the change. Is there typically a delay before df can detect that a large file has been deleted?
dan's user avatar
  • 917
14 votes
9 answers
24k views

Home-brew automatic tiered storage solutions with Linux? (Memory -> SSD -> HDD -> remote storage)

Related to this question about using an SSD for system and HDD for data, except I would like my system to do this automatically... Is it possible to have several layers of storage and push items ...
David Gardner's user avatar
14 votes
8 answers
8k views

Deleting a UNIX directory with a hyphen in the name

Through a boneheaded maneuver on my part, I accidentally created a directory called (for instance) -A, and ended up filling it with files. I want to delete said directory. I've tried: rmdir -- -A ...
Kate Bertelsen's user avatar
12 votes
2 answers
35k views

execute su -c over ssh

I am trying to check the BIOS version of a server over SSH, a command that requires root privileges: ssh remote-server su -c dmidecode but this of course fails with the error: standard in must be ...
aaron's user avatar
  • 751
11 votes
4 answers
28k 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.
Phil's user avatar
  • 113
10 votes
9 answers
18k 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?
Yuval A's user avatar
  • 257
9 votes
2 answers
3k views

Why can the root user edit read-only files, but a regular user with sudo access can't?

If you try to append to a file with no write permissions (say, the /etc/sudoers file which is is owned by root and has 0440 permissions), if you're the actual root user, this works. However, if you're ...
fields's user avatar
  • 690
9 votes
2 answers
14k views

Cannot ping over LAN until a ping is received

I have two OSX machines on a local subnet. Pings from Machine A to Machine B consistently timeout until Machine B pings Machine A. After B pings A, A can successfully ping B, but this success is ...
ericsoco's user avatar
  • 193
6 votes
3 answers
288 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 ...
Aron Rotteveel's user avatar
6 votes
3 answers
854 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.
Alex's user avatar
  • 8,591