Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

44
votes
3answers
7k 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 ...
253
votes
12answers
80k 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 ...
39
votes
23answers
62k 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)
99
votes
7answers
35k 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 ...
112
votes
7answers
209k 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 ...
36
votes
8answers
44k 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, ...
15
votes
8answers
5k 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 ...
100
votes
4answers
172k 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? Thanks.
57
votes
8answers
129k 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&...
40
votes
3answers
32k 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 ...
9
votes
2answers
14k 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?
213
votes
13answers
121k 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 ...
9
votes
10answers
5k 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&...
40
votes
3answers
20k 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 ...
16
votes
2answers
8k 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:...
10
votes
2answers
11k 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 ...
50
votes
2answers
7k 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 ...
13
votes
1answer
457 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 ...
4
votes
1answer
4k 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 ...
10
votes
1answer
44k 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
1answer
1k 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 ...
2
votes
8answers
1k 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.
370
votes
5answers
162k 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 found ...
132
votes
9answers
114k 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 ...
61
votes
4answers
30k 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 ...
56
votes
4answers
43k 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.
27
votes
10answers
9k 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?
27
votes
5answers
4k 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
8answers
16k 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 ...
36
votes
7answers
38k views

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

Virtual Shotguns?
24
votes
10answers
5k 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 ...
21
votes
2answers
17k 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?
33
votes
5answers
39k 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 ...
19
votes
4answers
12k 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 ...
3
votes
2answers
9k views

Incremental Backups of SVN Repository daily ? (OS = UNIX)

the first part of question how i can make Incremental Backups of SVN Repository ? what is the command do this ....... and how i can do this automatically (OS + UNIX)
27
votes
3answers
24k views

Create Unix Named Socket from the Command Line

Is there a command similar to mkfifo but for domain sockets?
13
votes
7answers
5k 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 ...
10
votes
9answers
17k 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?
10
votes
4answers
20k 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.
5
votes
5answers
4k 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 ...
40
votes
7answers
43k 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 ...
7
votes
2answers
9k 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 ...
5
votes
3answers
592 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.
5
votes
8answers
805 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 ...
5
votes
3answers
230 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
2answers
6k 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 ...
0
votes
4answers
372 views

No longer have to enter a password to SSH into another server?

For some reason, I have a server that if ssh into another server...you don't need to enter the password. How is this done? Can someone give me step by step instructions please?
1
vote
2answers
4k 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
234 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
4answers
1k views

direct file transfer via ftp to ftp

Hi i want to transfer few file (which is very big in size ) from A server to B server via ftp. I have credentials of Server A's ftp and Server B's ftp - server B is my own server running unix. so ...