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

14
votes
8answers
4k 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 ...
14
votes
6answers
8k views

Git - post-receive hook with git pull “Failed to find a valid git directory”

It's very weird but when setting a git repository and creating a post-receive hook with: echo "--initializing hook--" cd ~/websites/testing echo "--prepare update--" git pull echo "--update ...
14
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 ...
14
votes
3answers
18k views

Getting rsync to move file from source to destination?

Is rsync is a good choice for my project ? I have to : - copy files from source to destination folder via SSH, - be sure all files are copied, - delete source files after copy. - if I have conflict ...
13
votes
4answers
4k views

What is the “slash” after the IP?

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.
13
votes
3answers
1k views

When should I use “nohup”, and when should I use “&”?

I never know when's the best time to use nohup and the & at the end of the command.
13
votes
1answer
8k views

rsync - Exclude files that are over a certain size?

I am doing a backup of my desktop to a remote machine. I'm basically doing rsync -a ~ example.com:backup/ However there are loads of large files, e.g. wikipedia dumps etc. Most of the files I care a ...
13
votes
6answers
1k views

Building a Linux Network for Our Company - Where Do I Start?

This is going to be a somewhat loaded question. I am programming in a company that has been around since 1962. A lot of things, especially computer / network stuff, is very dated. Let me give a bit ...
13
votes
3answers
5k views

Override MAILTO for a single crontab entry

We have a role account at work that has a pretty big crontab. Its MAILTO is pointed at a shared address, so that a number of us get notified if something fails. I'd like to add an entry to this ...
13
votes
3answers
795 views

Is there a mechanism in Unix (or Linux) to stop an in-progress core dump?

Let's say a (very) large process is crashing and dumping core, and we know the cause from other information (possibly an assert message, maybe something else). Is there a way to stop the core dump ...
12
votes
14answers
1k views

Why pay for UNIX?

I'm fairly new to Unicies. With the advent of GNU/Linux and BSDs, what are the reasons for companies to prefer AIX, Solaris and other commercial systems?
12
votes
6answers
13k views

What's the maxium number of files a Unix folder can hold?

What's the maxium number of files a Unix folder can hold? I think it will be the same as the number of files.
12
votes
4answers
2k views

how many user accounts can a unix-like OS host?

Let's say I want to have a server with as many user accounts as possible. How many is the max? I want millions of user accounts. Is that crazy? I'd host dozens of load-balance mirrors of the box, ...
12
votes
2answers
2k views

Linux/Debian - What does 'pee' in moreutils do?

I recently discovered the 'moreutils' package in Debian (and Ubuntu). It's a collection of convenient unix tools. One of the commands is 'pee'. The man page says: pee is like tee but for pipes. ...
12
votes
11answers
7k views

Best way to go about changing a root password on 3000+ Solaris, AIX, and Linux servers?

Long story short: Big old corporation, lots of UNIX/Linux servers. I inherited responsibility for a bunch of scripts that that left a few years ago. One of them was a script that would be run every ...
12
votes
3answers
8k views

What are the advantages/disadvantages of hard versus soft mounts in UNIX?

This question may vary between distros but, in general, what are the advantages/disadvantages of using a hard or soft mount in the UNIX world? Are there certain situations where one is more ...
12
votes
1answer
368 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 ...
11
votes
6answers
2k 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 ...
11
votes
3answers
3k views

A better unix find with parallel processing?

The unix find(1) utility is very useful allowing me to perform an action on many files that match certain specifications, e.g. find /dump -type f -name '*.xml' -exec java -jar ProcessFile.jar {} \; ...
11
votes
8answers
11k views

Is it possible to hide lost+found?

Given a partition intended solely for storing music, video and so-on, is it possible to hide the lost+found directory?
11
votes
6answers
30k views

How to change owner of mount point

We have moved mysql data directory to another disk, so now /var/lib/mysql is just a mount point to another partition. We set the owner of the /var/lib/mysql directory to mysql.mysql. But everytime we ...
11
votes
4answers
9k views

How can I run mongod in the background on unix (mac osx)?

I would like to run mongod in the background as an always present sort of thing. What would be the best way to do this? Kind of like the way I can run MySQL on startup and it's just always there ...
11
votes
4answers
3k views

Available disk space on Unix/Linux OS

How to get available disk space on Unix/Linux OS, including unallocated space (which wasn't assigned to any partitions)?
11
votes
9answers
5k views

How do I master the UNIX find command?

I think I am fairly advanced in my use of find but EVERY time I use it I cannot for the life of me remember the method to close the -exec option. I spend a good deal of time reading every time I use ...
11
votes
2answers
9k views

When to use single-quote, double-quote in grep?

While trying to search for a simple pattern "hello" in a file, all the following forms of grep work: grep hello file1 grep 'hello' file1 grep "hello" file1 Is there a specific case where one of ...
11
votes
5answers
3k views

What are the practical differences between Interix and Cygwin?

Both Interix and Cygwin appear to provide a Unix-like user environment in Windows. What are the practical differences between the two, in terms of, for example: Unix-like "feel" Performance Package ...
10
votes
5answers
2k views

Where do you normally keep your UNIX/Linux scripts?

There are numerous scripts that I have written for my server. Some of them are in my ~/scripts and some of them are in application directories. I am just wondering is there a directory that you would ...
10
votes
12answers
563 views

What's the first thing you check when an untouched unix server starts going berserk?

So you have this neatly setup unix server and it's super fast and works swell and everything is great for months, and suddenly all kinds of weird errors start showing up for a variety of different ...
10
votes
9answers
3k views

Multiple *NIX Accounts with Identical UID

I am curious whether there is a standard expected behavior and whether it is considered bad practice when creating more than one account on Linux/Unix that have the same UID. I've done some testing on ...
10
votes
9answers
14k views

How can I find the biggest directories in unix / Ubuntu?

Is there a way in Unix to see the biggest directories on disk ? I need to know why I'm almost done with the space on the server, and I dunno where most of the space is used.. thanks
10
votes
5answers
284 views

How do I change to the directory I just moved that file to?

So lets assume I've just done: mv ./myfile /to/some/other/place/ And I now decide I want to follow the file, and go into that directory. Whilst I could head for the mouse, select the text, type ...
10
votes
5answers
18k views

How to Chown a directory recursively including hidden files or directories

Seems like chown with the recursive flag will not work on hidden directories or files. Is there any simple workaround for that?
10
votes
8answers
17k views

Why can't I ssh into my new EC2 Instance?

I created a new instance (tiny, 64 bit AMI linux from Amazon) Created a new key pair called "mir". I downloaded mir.pem and put it in my ~/.ssh folder. I even did ssh-add mir.pem. Then I tried to ...
10
votes
3answers
13k views

.nfsXXXX files appearing, what are those?

We have an application running (on RHEL5), streaming data onto an NFS share. Recently we saw a lot of .nfsXXXX... (xxx being a hexadecimal number) appearing in its working directory, where the ...
10
votes
2answers
4k views

Making libmagic/file detect .docx files

As seen elsewhere, docx, xlsx and pttx are ZIPs. When uploading them to my web application, file (via libmagic andpython-magic) detects them as being ZIP. I store the contents of the file as a blob ...
10
votes
2answers
7k 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 ...
10
votes
3answers
387 views

How do I delete all empty directories

(on a Linux system) I have a large set of nested subdirectories on a filesystem. I would like to prune all directory paths that contain no files at all. In other words I would like to delete every ...
10
votes
1answer
3k views

Getting rsync to delete files from the *sender* after transfer

I'm using rsync to move one directory to another. Is there some way to get rsync to incrementally delete a file from the sender after it has copied it to the reciever?
10
votes
1answer
527 views

Can a very large /etc/hosts.deny slow down SSH connections?

I've been using denyhosts for a while and I noticed my /etc/hosts.deny is getting rather large. Denyhosts adds IPs to /etc/hosts.deny, and my denyhosts is configured to never purge IPs. $ wc -l ...
10
votes
5answers
5k views

Confused by CPU values in Unix 'top' command

In the screenshot below, the overall CPU is being reported as 3% but the mysqld process is reported as using 57%. Is this 57% of the overall 3% and thus mysqld is only using about 1.5% of the CPU? ...
10
votes
3answers
209 views

*nix convention for storing user logs?

What’s a conventional log location for processes that run on behalf of users? ~/.foo/logs/ — my top choice but not super awesome /var/log/foo.uid/ — Non-system users can’t create directories here, ...
9
votes
4answers
420 views

Linux cd .. command

Say if I need to do this a lot: cd ../../../../foo/sub1/bar/dest/ cd ../../../../foo2/sub1/bar/dest/ cd ../../../../foo3/sub1/bar/dest/ cd ../../../../foo/sub1/bar/dest/ Is there any faster way to ...
9
votes
4answers
5k views

When would ssh -t not be appropriate instead of ssh?

Using ssh -t instead of ssh for connections to remote servers has several advantages. For example, I can directly edit a file with vim: ssh -t host vim foo.txt, which would fail otherwise. Are there ...
9
votes
2answers
9k views

filebucket configuration in Puppet

How do you configure and work with your Puppet filebucket? I'd like to: Store file bucket data on a single server Be able to audit/parse/prune the file bucket when necessary Ensure that ...
9
votes
4answers
183 views

Books or Webpages on the Windows Philosophy

For *nix, I found that Eric Raymond's The Art Of Unix Programming expressed the ideas behind the Unix philosophy pretty well. The whole book is online, I recommend this chapter to see what I am ...
8
votes
3answers
4k views

Unix magic, delete all .pyc files from a tree of directories?

Is there a quick way of deleting all the .pyc files from a tree of directories?
8
votes
2answers
10k views

Getting the last match in a file using grep

What's the best way of getting only the final match of a regular expression in a file using grep? Also, is it possible to begin grepping from the end of the file instead of the beginning and stop ...
8
votes
2answers
2k views

unix user alias

is there a way to set up user aliases in unix such that if you have a user, my_user, they can log in with an alternate username, i.e. my_user_alternate and still be logged in as my_user?
8
votes
8answers
8k 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 ...
8
votes
3answers
1k views

OS X: What does the '@' attribute on a file mean?

On a Snow Leopard machine, at the Terminal: la ~/src/rmcl/ | grep RMCL -rw-r--r--@ 1 claytonstanley staff 6766167 Nov 13 2009 RMCL What is that '@' attribute? This file is part of an older OS ...