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
22
votes
2 answers

unix sorting, with primary and secondary keys

I would like to sort a file on more fields. A sample tab separated file is: a 1 1.0 b 2 0.1 c 3 0.3 a 4 0.001 c 5 0.5 a 6 0.01 b 7 0.01 a 8 0.35 b 9 2.3 c 10 0.1 c 11 1.0 b 12 3.1 a 13 2.1 And i would…
zseder
  • 1,099
  • 2
  • 12
  • 15
22
votes
2 answers

Read line by line from standard input Bash

I'm studying bash language and an exam track says this: It should read one input (from standard input) at a time (each entry is a string and then ends with a newline). My questions are two: How do I read line by line from standard input in…
mario razzu
  • 333
  • 1
  • 5
  • 12
22
votes
4 answers

ack-grep: chars escaping

My goal is to find all "
user80805
  • 6,088
  • 5
  • 28
  • 31
22
votes
3 answers

How to convert RTF to Markdown on the UNIX/OSX command line similar to pandoc

How do I convert RTF (say from stdin) to Markdown with a command line tool under UNIX/OSX. I am looking for something like pandoc. However pandoc itself does not allow RTF as an input format. :-( So, I'd be happy either with a similar tool to pandoc…
halloleo
  • 9,216
  • 13
  • 64
  • 122
22
votes
2 answers

remove white space in bash using sed

I have a file that contains a number followed by a file path on each line for a large amount of files. So it looks like this: 7653 /home/usr123/file123456 But the problem with this is there is 6 empty white spaces before it which throws off…
Sal
  • 625
  • 2
  • 7
  • 11
22
votes
1 answer

How to view and edit the ephemeral port range on Linux?

In my Linux system ephemeral port range is showing different ranges as follows $ cat /proc/sys/net/ipv4/ip_local_port_range 32768 61000  cat /etc/sysctl.conf | grep net.ipv4.ip_local_port_range net.ipv4.ip_local_port_range = 9000…
Steephen
  • 14,645
  • 7
  • 40
  • 47
22
votes
2 answers

PostgreSQL fe_sendauth: no password supplied

I know there are thousands of questsions like this one here on SO but i've seen them all and i'm still not able to deal with my problem. I'm doing everything using ansible so it's quite automated but, anyway, here are my files: pg_hba.conf local …
mbajur
  • 4,406
  • 5
  • 49
  • 79
22
votes
3 answers

How do Cron "Steps" Work?

I'm running into a situation where a cron job I thought was running every 55 minutes is actually running at 55 minutes after the hour and at the top of the hour. Actually, it's not a cron job, but it's a PHP scheduling application that uses cron…
Alana Storm
  • 164,128
  • 91
  • 395
  • 599
22
votes
3 answers

AWK to use multiple spaces as delimiter

I am using below command to join two files using first two columns. awk 'NR==FNR{a[$1,$2]=substr($0,3);next} ($1,$2) in a{print $0, a[$1,$2] > "br0102_3.txt"}' br01.txt br02.txt Now, by default AWk command uses whitespaces as the separators. But…
Apurv
  • 3,723
  • 3
  • 30
  • 51
22
votes
2 answers

Detecting a symlink in Java

Given a Java 'File' object, how can I detect whether or not it refers to a symlink? (If it helps/matters, I know the file refers to a directory, not to a file)
Matt Sheppard
  • 116,545
  • 46
  • 111
  • 131
22
votes
3 answers

See what API calls of a website is making

Is it possible to see what rest calls a page makes when I visit it? Like if I go to google drive, can I see what calls my browser is making to their web servers? If so how? Would something like Wireshark be used in this case? Is there something…
owenlero
  • 277
  • 1
  • 3
  • 9
22
votes
2 answers

Print only matching word, not entire line through grep

I am familiar with shell programming in bash, but for some reason egrep -o to print only matching words is not working and displays error as below. Environment is ksh unix console on putty and not linux or ubuntu terminal......any advice is…
NoobEditor
  • 15,563
  • 19
  • 81
  • 112
22
votes
3 answers

How can I make the watch command interpret vt100 sequences?

Consider this simple example (which displays in red): echo -e "\033[31mHello World\033[0m" It displays on the terminal correctly in red. Now consider: watch echo -e "\033[31mHello World\033[0m" It does not display the color. Note: I am aware that it…
frankc
  • 11,290
  • 4
  • 32
  • 49
22
votes
10 answers

What is the unix command to see how much disk space there is and how much is remaining?

I'm looking for the equivalent of right clicking on the drive in windows and seeing the disk space used and remaining info.
Brian
  • 13,412
  • 10
  • 56
  • 82
22
votes
5 answers

Is there a shortcut for word boundary in `less`?

This is the less I am using: less 458 (POSIX regular expressions) Copyright (C) 1984-2012 Mark Nudelman In Vim it is \< and \>, in most other regex it is \b.
Steven Lu
  • 41,389
  • 58
  • 210
  • 364