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

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 under ~/.ssh. I'd like to change the private…
kch
  • 4,592
  • 3
  • 20
  • 17
361
votes
18 answers

How do I get the current Unix time in milliseconds in Bash?

How do I get the current Unix time in milliseconds (i.e number of milliseconds since Unix epoch January 1 1970)?
Richard
  • 3,892
  • 2
  • 18
  • 13
336
votes
18 answers

Copying a large directory tree locally? cp or rsync?

I have to copy a large directory tree, about 1.8 TB. It's all local. Out of habit I'd use rsync, however I wonder if there's much point, and if I should rather use cp. I'm worried about permissions and uid/gid, since they have to be preserved in the…
Amandasaurus
  • 31,471
  • 65
  • 192
  • 253
283
votes
13 answers

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 screen. Is there any way to "retroactively" nohup a…
ojrac
  • 2,933
  • 3
  • 18
  • 5
245
votes
13 answers

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 environment variable. How can I accomplish the same…
Gant
  • 2,595
  • 2
  • 16
  • 8
229
votes
19 answers

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 to test wildcard sub-domains on my localserver. …
MikeN
  • 8,442
  • 5
  • 23
  • 18
227
votes
3 answers

How do I do 'mount --bind' in /etc/fstab?

I'm trying to add mount --bind /proc/ /chroot/mysql/proc to /etc/fstab. How can I do this?
Some Linux Nerd
  • 3,327
  • 3
  • 19
  • 22
226
votes
8 answers

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 Fedora desktop versions. But a nice general way of…
John Lawrence Aspden
  • 2,536
  • 4
  • 17
  • 12
213
votes
11 answers

How to read backward from the end of file in less or more?

I've found one way so far: less +G filename, but it scrolls up line-by-line only with ↑. What's a more powerful less usage which provides scrolling by page, backward pattern search, and so on?
yetanothercoder
  • 2,235
  • 2
  • 14
  • 6
188
votes
6 answers

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
  • 2,175
  • 3
  • 16
  • 17
175
votes
9 answers

Is it possible to detach a process from its terminal? (Or, "I should have used screen!")

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 that the job is going to take several hours. If I…
mike
  • 3,963
  • 11
  • 30
  • 27
163
votes
8 answers

What does 'set -e' do, and why might it be considered dangerous?

This question has appeared on a pre-interview quiz and it's making me crazy. Can anyone answer this and put me at ease? The quiz has no reference to a particular shell but the job description is for a unix sa. again the question is simply... What…
egorgry
  • 2,871
  • 2
  • 23
  • 21
152
votes
9 answers

How to remove empty/blank lines from a file in Unix (including spaces)?

How do I remove empty/blank (including spaces only) lines in a file in Unix/Linux using the command line? contents of file.txt Line:Text 1: 2:AAA 3: 4:BBB 5: 6:CCC 7: 8:DDD output desired…
Michael Ellick Ang
  • 2,039
  • 3
  • 14
  • 15
146
votes
7 answers

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 or var? Where does the opt name come from? And…
Luke
  • 3,826
  • 8
  • 36
  • 40
132
votes
8 answers

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 a TIME_WAIT state. Is there a program you can…
Rehan
  • 1,423
  • 2
  • 10
  • 5
1
2 3
99 100