Questions tagged [unix]

This tag is EXCLUSIVELY for PROGRAMMING questions that are directly related to Unix; general software issues should be directed to the Unix & Linux Stack Exchange site or to Super User. The Unix operating system is a general-purpose OS that was developed by Bell Labs in the late 1960s and today exists in various versions.

Tag usage

The tag can be used for Unix system programming related problems. The tag can also contain programming questions about using the Unix platform. For non-programming Unix usage questions, visit the Unix & Linux Stack Exchange site.

Background

Unix was developed as an in-house operating system for AT&T, but in the 1980s became both a prime academic operating system (with U.C. Berkeley's version, called BSD, being the reference platform for development of what would become the Internet) and a commercial success in the form of AT&T's System V, Microsoft/SCO's XENIX (PCs) and various workstation versions from Sun, Silicon Graphics, and others.

In the 1990s, Sun's Solaris and the free Unix clone Linux would rise in popularity. Linux is largely Unix-compatible but lacks the trademark. Currently, Unix is commonly found on server platforms; the primary desktop variant is Mac OS X, based on BSD.

Apart from its command-line interface, most "Unices" support the standardized X Window System for GUIs. (So does Mac OS X, but its primary GUI is Apple's proprietary Quartz.)

The various Unix implementation (and to a lesser extent, clones such as Linux) are unified in a standard called POSIX. C has been its primary programming language since the 1970s, but many other languages are available.

Read more

45195 questions
17
votes
2 answers

How can I pass a parameter to a t-sql script?

CREATE TABLE DMS_POP_WKLY_REFRESH_20100201 NOLOGGING PARALLEL AS SELECT wk.*,bbc.distance_km ,NVL(bbc.tactical_broadband_offer,0) tactical_broadband_offer , sel.tactical_select_executive_flag, sel.agent_name, …
user270203
  • 179
  • 1
  • 1
  • 4
17
votes
5 answers

How to run a command recursively on all files except for those under .svn directories

Here is how i run dos2unix recursively on all files: find -exec dos2unix {} \; What do i need to change to make it skip over files under .svn/ directories?
zr.
  • 6,870
  • 8
  • 45
  • 80
17
votes
4 answers

Excel saves tab delimited files without newline (UNIX/Mac os X)

This is a common issue I have and my solution is a bit brash. So I'm looking for a quick fix and explanation of the problem. The problem is that when I decide to save a spreadsheet in excel (mac 2011) as a tab delimited file it seems to do it…
IMPERATOR
  • 267
  • 1
  • 2
  • 14
17
votes
5 answers

Is 0 or 1 valid return values for socket() function call

Could the socket function call in C return 0 or 1 as the value for the socket descriptor? int socket(int domain, int type, int protocol); According to the man page I have: RETURN VALUE -1 is returned if an error occurs; otherwise the …
Alan H
  • 2,713
  • 4
  • 22
  • 22
17
votes
2 answers

What does "high involuntary context" switches mean?

I have re-written a part of code in C. When testing it with logging the resource usage using getrusage(2) C API. Before changing the code: user time (ms): 21503 system time (ms): 372 involuntary context switches: 20 After changing: user time (ms):…
Ashwin
  • 1,872
  • 4
  • 26
  • 57
17
votes
5 answers

Print lines in one file matching patterns in another file

I have a file with more than 40.000 lines (file1) and I want to extract the lines matching patterns in file2 (about 6000 lines). I use grep like this, but it is very slow: grep -f file2 file1 > out Is there a faster way to do this using awk or…
Jon
  • 581
  • 2
  • 8
  • 16
17
votes
2 answers

How does traceroute work?

It seems almost magical. What is the traceroute command doing in order to map out the entire path to some other node on the Internet?
raldi
  • 19,496
  • 29
  • 73
  • 85
17
votes
2 answers

How do I change a shell scripts character encoding?

I am using Gina Trapiani's excellent todo.sh to organize my todo-list. However being a dane, it would be nice if the script accepted special danish characters like ø and æ. I am an absolute UNIX-n00b, so it would be a great help if anybody could…
timkl
  • 3,215
  • 10
  • 52
  • 69
17
votes
3 answers

Convert a text string in bash to array

How do i convert a string like this in BASH to an array in bash! I have a string str which contains "title1 title2 title3 title4 title5" (space seperated titles) I want the str to modified to an array which will store each title in each index.
Ayush Mishra
  • 1,113
  • 3
  • 9
  • 13
17
votes
6 answers

Shell script change directory with variable

I know this question has been asked numerous times, but I still could not find any good solution. Hence, asking it again if anyone can help !! I am trying to change a my working directory inside a shell script with help of a variable. But I get " No…
Vivek
  • 817
  • 4
  • 11
  • 17
17
votes
3 answers

Why doesn't **find** find anything?

I'm looking for shell scripts files installed on my system, but find doesn't work: $ find /usr -name *.sh But I know there are a ton of scripts out there. For instance: $ ls /usr/local/lib/*.sh /usr/local/lib/tclConfig.sh …
Jon Ericson
  • 19,534
  • 11
  • 93
  • 140
17
votes
5 answers

Explain awk command

Today I was searching for a command online to print next two lines after a pattern and I came across an awk command which I'm unable to understand. $ /usr/xpg4/bin/awk '_&&_--;/PATTERN/{_=2}' input Can someone explain it?
CBR
  • 722
  • 1
  • 6
  • 23
17
votes
4 answers

Why does the "at" command always warn me that commands will be executed via sh?

Every time I use the "at" command, I get this message: warning: commands will be executed using /bin/sh What is it trying to warn me about? More importantly, how do I turn the warning off?
raldi
  • 19,496
  • 29
  • 73
  • 85
17
votes
4 answers

How to replace to apostrophe ' inside a file using SED

I have a file "test.txt" that contain the following +foo+ +bar+ What I want to do is to replace them into: 'foo' 'bar' But why this code doesn't work? sed 's/\+/\'/' test.txt What's the right way to do it?
neversaint
  • 50,277
  • 118
  • 274
  • 437
17
votes
5 answers

Linux: How to find the list of daemon processes and zombie processes

I tried checking on Google, but I couldn't find much information related to the actual question. How do I get a consolidated list of zombie processes and daemon processes? How do I do it on different operating systems. Linux? AIX? Windows? I am…
kris123456
  • 481
  • 1
  • 4
  • 14
1 2 3
99
100