Questions tagged [unix]

NOTICE: All Unix questions must be related to programming; those that aren't will be closed. Use this tag only if your question relates to programming using Unix APIs or Unix-specific behavior, not just because you happen to run your code on Unix. General software issues should be directed to Unix & Linux Stack Exchange or to Super User.

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

47509 questions
20
votes
10 answers

changing to parent directory in unix

in general we use cd .. for going to the parent directory cd ../../ to go to the parents parent directory. and cd ../../../../../ for 5th parent directory. is there any simplified way of doing this? shell i am using is ksh.
Vijay
  • 65,327
  • 90
  • 227
  • 319
20
votes
8 answers

How to perform the reverse of `xargs`?

I have a list of numbers that I want to reverse. They are already sorted. 35 53 102 342 I want this: 342 102 53 35 So I thought of this: echo $NUMBERS | ??? | tac | xargs What's the ??? It should turn a space separated list into a line separated…
Steven Lu
  • 41,389
  • 58
  • 210
  • 364
20
votes
6 answers

Differences between unix and windows files

Am I correct in assuming that the only difference between "windows files" and "unix files" is the linebreak? We have a system that has been moved from a windows machine to a unix machine and are having troubles with the format. I need to automate…
svrist
  • 7,042
  • 7
  • 44
  • 67
20
votes
1 answer

what is the relationship between X11 and gnome?

is there a relationship between X11 and gnome ? does the gnome uses the X11 interface to display ? or does the gnome implements some functionality that the X11 requires ?
shd
  • 1,201
  • 4
  • 17
  • 29
20
votes
3 answers

Create a hard link from a file handle on Unix?

If I've got a handle to an open file, is it possible to create a hard link to that file after all references to it have been removed from the filesystem? For example, something like this: fd = fopen("/tmp/foo", "w"); unlink("/tmp/foo"); fwrite(fd,…
David Wolever
  • 148,955
  • 89
  • 346
  • 502
20
votes
2 answers

Reading file line by line (with space) in Unix Shell scripting - Issue

I want to read a file line by line in Unix shell scripting. Line can contain leading and trailing spaces and i want to read those spaces also in the line. I tried with "while read line" but read command is removing space characters from line…
Sourabh Saxena
  • 211
  • 1
  • 2
  • 5
20
votes
2 answers

Redirect output to a file permission denied?

I want to do a simple redirection. When I do sudo curl > a.txt I want to take all of the data outputted by the curl into a.txt. However, I keep getting an error saying a.txt: Permission denied Would anyone have any idea how to…
user1871869
  • 3,317
  • 13
  • 56
  • 106
20
votes
5 answers

How do I include a blank line between files I'm concatenating with "cat"?

I want to cat all the files in a directory, but include some spacer between each one.
Matt
  • 269
  • 1
  • 3
  • 10
20
votes
5 answers

Make Arrow and delete keys work in KornShell command line

I am new to Unix and am using sun solaris (v10 I think). I have my shell set as KornShell (ksh). I am wondering how to make the arrow keys and delete key work in the command line. I have done set -o emacs and the backspace works, but not the arrow…
user66854
  • 865
  • 3
  • 11
  • 15
20
votes
1 answer

Why does the shelve module in python sometimes create files with different extensions?

I'm running a Python program which uses the shelve module on top of pickle. After running this program sometimes I get one output file as a.data but at other times I get three output files as a.data.bak, a.data.dir and a.data.dat. Why is that?
Ali_IT
  • 7,551
  • 8
  • 28
  • 44
20
votes
6 answers

Good collection of libraries for C?

I'm looking for a good collection of libraries for ANSI-C, stuff for handling vectors, hash maps, binary tress, string processing, etc.
thr
  • 19,160
  • 23
  • 93
  • 130
20
votes
5 answers

bash: put list files into a variable and but size of array is 1

I am listing the files in a directory and looping through them okay, BUT I need to know how many there are too. ${#dirlist[@]} is always 1, but for loop works? #!/bin/bash prefix="xxx"; # as example len=${#prefix}; # string length dirlist=`ls…
Waygood
  • 2,657
  • 2
  • 15
  • 16
20
votes
13 answers

How to resolve /var/www copy/write permission denied?

I am a newbie in php, mysql. I have written a hello.php script, which I am trying to copy into /var/www directory (and will later want to open it through web browser). The problem with the same is that I am not allowed to save/write any files in…
shubster
  • 825
  • 4
  • 13
  • 39
20
votes
3 answers

Fastest way to shuffle lines in a file in Linux

I want to shuffle a large file with millions of lines of strings in Linux. I tried 'sort -R' But it is very slow (takes like 50 mins for a 16M big file). Is there a faster utility that I can use in the place of it?
alpha_cod
  • 1,933
  • 5
  • 25
  • 43
20
votes
1 answer

Suppress log entry for single sudo commands

For server monitoring, we execute couple of commands with password-less sudo every minute. This fills the server logs. sudo: zabbix : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/foo/bar Can I prevent these entries? The options NOLOG_INPUT and…
StephenKing
  • 36,187
  • 11
  • 83
  • 112
1 2 3
99
100