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
124
votes
3 answers

How can I rename a Unix user?

I have a user named hedgehog and I want him to be named squirrel, but I don't want to change his numeric user ID. How can I accomplish this?
Szymon Jeż
  • 3,377
  • 3
  • 17
  • 17
122
votes
8 answers

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 '// {print $2}' Because processes names are not…
rafalmag
  • 1,331
  • 2
  • 9
  • 9
102
votes
8 answers

Can you have more than one ~/.ssh/config file?

We have a bastion server that we use to connect to multiple hosts, and our .ssh/config has grown to over a thousand lines (we have hundreds of hosts that we connect to). This is beginning to get a little unwieldy and I'd like to know if there is a…
wrangler
  • 3,080
  • 5
  • 24
  • 20
97
votes
10 answers

How to disable everything in crontab -l?

I just want to pause everything. Don't execute anything listed on crontab -l.
Alex
  • 8,471
  • 26
  • 75
  • 99
91
votes
7 answers

How to sort ps output by process start time?

Is there a way to sort ps output by process start time, so newest are either at the top or bottom ? On Linux ? On SysV5 ? On Mac ?
Dean Smith
  • 1,270
  • 2
  • 11
  • 13
89
votes
5 answers

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 when it finds the first match?
Acorn
  • 1,057
  • 1
  • 7
  • 10
83
votes
10 answers

How to check what port mysql is running on

On my windows dev box mysql is running on port 3306 How can I check what port it is running on the unix server that I have to upload the app to.
Ankur
  • 2,379
  • 7
  • 22
  • 24
70
votes
4 answers

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.
Alex
  • 8,471
  • 26
  • 75
  • 99
69
votes
3 answers

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 to a central Nagios sever. This send_nsca script…
Stefan Lasiewski
  • 23,667
  • 41
  • 132
  • 186
68
votes
8 answers

Is there a way to redirect output to a file without buffering on unix/linux?

I have a long running batch process that outputs some debug and process information to stdout. If I just run from a terminal I can keep track of 'where it is' but then the data gets too much and scrolls off the screen. If I redirect to output to a…
James Dean
  • 801
  • 1
  • 7
  • 5
67
votes
4 answers

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 time?
nos
  • 2,418
  • 3
  • 21
  • 24
66
votes
9 answers

How do I determine the block size of an ext3 partition on Linux?

How do I determine the block size of an ext3 partition on Linux?
mike
  • 3,963
  • 11
  • 30
  • 27
66
votes
2 answers

Bash: Difference between > and >> operator?

I don't know much about bash. My instructor asked me to make a cat script and to observe the output and then tell what is the operator > and what is the difference between the operators > & >>. I am unable to find any justifications. Could you…
jumbo18
  • 677
  • 1
  • 5
  • 3
63
votes
8 answers

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 mount the partition, the ownership changes to…
Arie K
  • 1,633
  • 5
  • 19
  • 27
62
votes
5 answers

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 {} \; The above might run a script or tool over every…
PP.
  • 3,316
  • 6
  • 27
  • 31