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.

Excerpt from the Wikipedia page

Unix was originally written in assembly but has since been rewritten in C. It has been branched many times both commercially and open source. One popular variant is the BSD variant which originated from the University of California, Berkeley. It also gave rise to Linux.

Notable variants

  • Silicon Graphics - Irix
  • IBM - AIX
  • Sun Microsystems - Solaris
  • Hewlett Packard - HP-UX

Unix is officially trademarked as UNIX.

Unix on Wikipedia

1949 questions
60
votes
18 answers

Favorite rsync tips and tricks

The more I use rsync the more I realise that it's a swiss army knife of file transfer. There are so many options. I recently found out that you can go --remove-source-files and it'll delete a file from the source when it's been copied, which makes…
Amandasaurus
  • 31,471
  • 65
  • 192
  • 253
60
votes
6 answers

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 running in the background. Maybe it's just some bash…
rmontgomery429
  • 749
  • 1
  • 8
  • 8
60
votes
3 answers

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 other? Or do they just serve two distinct purposes?
Aaron K
  • 1,525
  • 5
  • 18
  • 16
59
votes
1 answer

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 lot about a small, such as firefox cookie files,…
Amandasaurus
  • 31,471
  • 65
  • 192
  • 253
57
votes
10 answers

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 out of space on the server,= and I don't know where most of the space is used.
aneuryzm
  • 1,714
  • 5
  • 26
  • 41
57
votes
6 answers

How do I print contents of at jobs?

I have a Debian box with some jobs scheduled using at. I know I can list the jobs with their times using atq, but is there any way to print out their contents, apart from peeking into /var/spool/cron/atjobs?
che
  • 719
  • 1
  • 5
  • 13
56
votes
4 answers

how to run cron job every 3 months?

What would be the crontab entry look like for a job that runs on the first day of every third month?
haim evgi
  • 753
  • 1
  • 10
  • 15
55
votes
5 answers

What is the first digit for in 4-digit octal Unix file permission notation?

3-digit: 644 ugo (user group other) 4-digit: 0644 ?ugo (??? user group other) What is the first octal digit for in 4-digit octal Unix file permission notation?
Steven T. Snyder
  • 1,113
  • 2
  • 10
  • 19
54
votes
7 answers

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 root root 4096 2009-06-06 18:52…
Deleted
  • 1,832
  • 8
  • 23
  • 31
54
votes
2 answers

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 this?
Brian Lyttle
  • 1,757
  • 1
  • 17
  • 17
54
votes
1 answer

Capturing STDERR and STDOUT to file using tee

I'm unclear what the best order is to capture both STDERR and STDOUT to the same file using tee. I know that if I want to pipe to a file I have to map the filehandle after the redirect, i.e. find . >/tmp/output.txt 2>&1 This instructs the shell to…
PP.
  • 3,316
  • 6
  • 27
  • 31
54
votes
3 answers

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 a Python WSGI server (uWSGI) but I'm just…
Ludo
  • 1,099
  • 3
  • 10
  • 11
53
votes
10 answers

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?
toby
  • 631
  • 1
  • 5
  • 6
52
votes
6 answers

Bash Loop - How to stop the loop when I press Control-C inside a command?

I am rsyncing a few directories. I have a bash terminal open and am executing something like this: for DIR in * ; do rsync -a $DIR example.com:somewhere/ ; done However if I want to stop the whole things, I press Control-C. That stops the rsync,…
Amandasaurus
  • 31,471
  • 65
  • 192
  • 253
51
votes
6 answers

How to make a global ~/.vimrc?

Right now, I make everyone do ~/.vimrc and put their settings there. How can I make a global, default .vimrc for new users?
Alex
  • 8,471
  • 26
  • 75
  • 99