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
24
votes
4 answers

How to display /proc/meminfo in Megabytes?

I want to thank you for helping me my related issue. I know if I do a cat /proc/meminfo it will only display in kB. How can I display in MB? I really want to use cat or awk for this please.
javanoob17
  • 243
  • 1
  • 3
  • 10
24
votes
1 answer

Error: "grep: Argument list too long"

I am trying to run the following command, but gets argument too long error. Can you help?. HOST# grep -rl 'pattern' /home/*/public_html/* -bash: /bin/grep: Argument list too long Is there a way to override this error and grep the pattern matching…
John
  • 289
  • 1
  • 3
  • 7
24
votes
6 answers

How to transfer a file between two remote servers using scp from a third, local machine?

I'm trying to copy a file from one remote server to another remote server from my local machine. Here's what I'm trying to do localA $ scp userB@remoteB:/path/to/file userC@remoteC:/path The problem is that I need to pass two passwords for both…
Alan
  • 1,479
  • 3
  • 20
  • 36
24
votes
3 answers

How to include clean target in Makefile?

I have a Makefile that looks like this CXX = g++ -O2 -Wall all: code1 code2 code1: code1.cc utilities.cc $(CXX) $^ -o $@ code2: code2.cc utilities.cc $(CXX) $^ -o $@ What I want to do next is to include clean target so that every time I…
neversaint
  • 60,904
  • 137
  • 310
  • 477
24
votes
5 answers

How to check if a user exists in a GNU/Linux OS using Python?

What is the easiest way to check the existence of a user on a GNU/Linux OS, using Python? Anything better than issuing ls ~login-name and checking the exit code? And if running under Windows?
Elifarley
  • 1,310
  • 3
  • 16
  • 23
24
votes
2 answers

Customizing bash completion output: each suggestion on a new line

When you type something, you often use bash autocompletion: you start writing a command, for example, and you type TAB to get the rest of the word. As you have probably noticed, when multiple choices match your command, bash displays them like this…
4wk_
  • 2,458
  • 3
  • 34
  • 46
24
votes
2 answers

wait(null) and wait(&status) C language and Status

What is the difference between wait(null) and wait(&status) in c system programming? And what is the content of the pointer status ?
user3260388
  • 313
  • 1
  • 4
  • 10
24
votes
5 answers

Where to view man pages for Bash builtin commands?

For example, when I type man fg, or man history, the same manpage, BUILTIN(1) will be displayed. There is a list of commands, but not the specification of their usage. Where can I find them?
franklsf95
  • 1,182
  • 12
  • 23
24
votes
2 answers

what is the meaning of this macro _IOR(MY_MACIG, 0, int)?

i was going through ioctl sample programs to check how it communicates with kernel space. in program WRITE_IOCTL is used as command #define WRITE_IOCTL _IOW(MY_MACIG, 1, int) ioctl(fd, WRITE_IOCTL, "hello world") I am not able to understand what…
Rafal
  • 1,120
  • 3
  • 15
  • 23
24
votes
6 answers

Are passwords on modern Unix/Linux systems still limited to 8 characters?

Years ago it used to be the case that Unix passwords were limited to 8 characters, or that if you made the password longer than 8 characters the extra wouldn't make any difference. Is that still the case on most modern Unix/Linux systems? If so,…
Chirael
  • 3,025
  • 4
  • 28
  • 28
24
votes
4 answers

How does a process come to know that it has received a signal

Please correct me if i am wrong. Here is my understanding about signals: As far as i know, signal generation and signal delivery are 2 different things. In order to generate a signal, the OS simply sets a bit in a bitarray maintained in the…
ghayalcoder
  • 1,675
  • 2
  • 17
  • 24
24
votes
3 answers

Top unix command ascending order

I am using Ubuntu 12.04 and have recently started working on bash. I need to display say memory or CPU in ascending order. command : top shift F, this shows window of all the column. I select n for memory and it is ordered in descending order. Same…
Death Metal
  • 830
  • 3
  • 9
  • 26
24
votes
4 answers

Redirecting output from a function block to a file in Linux

Just like we redirect output from a for loop block to a file for () do //do something //print logs done >> output file Similarly in shell script, is there a way to redirect output from a function block to a file, something like this? function…
dig_123
  • 2,240
  • 6
  • 35
  • 59
24
votes
3 answers

setting a gdb exit breakpoint not working?

I've set breakpoints on exit and _exit and my program (multithreaded app, running on linux 2.6.16.46-0.12 sles10), is somehow still exiting in a way I can't locate (gdb) c ... [New Thread 47513671297344 (LWP 15279)] [New Thread 47513667103040 (LWP…
Peeter Joot
  • 7,848
  • 7
  • 48
  • 82
24
votes
1 answer

How can you take ownership of a hid device?

What I would like to take ownership of a hid device that may already have been plugged in, consume it's output, while preventing others(X11 or terminal) from consuming it. If I can help it, I don't want to pretend to be a terminal, but rather to…
Catskul
  • 17,916
  • 15
  • 84
  • 113