Skip to main content

Posts

Showing posts from April 23, 2017

Relevant Linux Features: Go Forth And Explore

Go Forth And Explore You have just lightly scratched the surface… being fresh from a pedicure. You haven't touched any of the items below. The good news is that if you don't already know them, chances are you will not need them… at least not right away: 2>&1 Redirect STDERR and STDOUT to the same place Metacharacter A character that, when unquoted, separates words.  One of the following:               |  & ; ( ) < > space tab Operators ==, !=, =~, … control operator A token that performs a control function.  It is one of the following symbols:               || & && ; ;; ( ) | |& <newline> Process Status 'ps' command, e.g. 'ps -A' Shell scripting Compound commands && - e.g. apt-get update && apt-get install -y openssh-server List - (list

Relevant Linux Features: UNIX Domain Socket

UNIX Domain Socket UNIX domain socket , also known as IPC (inter-process communication) socket is a data communications endpoint for exchanging data between processes executing on the same host. Unlike a regular shell pipeline, or pipe ( | ), which allows communication between command and in only one direction, the UNIX domain socket is bi-directional , i.e. it enables a two-way communications channel. Similar concepts: TCP Sockets enables bi-directional communication channel between two endpoints over the Internet Pipes one-way communication channel between commands on the local host a sequence of processes chained together by their standard streams, where the standard output ( stdout ) of one process is fed to the next process through its standard input ( stdin ) FIFO First In First Out Also known as a named pipe unidirectional communication channel between two processes on the local host Can be accessed by two

Relevant Linux Features: Exit Status

Exit Status On Unix and Linux systems, every command ends with an exit status (also known as return status or exit code ). Exit status is an integer value ranging from 0 to 255 . By default, a command that ends "successfully" has an exit status of zero, 0 . A command that ends with a "failure" has a non-zero ( 1 - 255 ) exit status. Note: Success and failure, with respect to exit status is relative. By default if a command does what it's expected to do, on exit it sets a zero , 0, exit status. E.g. If the directory /var/log/apt exists, the command ls /var/log/apt will end successfully and result in an exit status of 0. However if the argument, in this case a directory, is not accessible the ls command will "fail" and leave a non-zero exit status: By convention, success results in an exit status of zero , however commands are generally free to decide what non-zero

Relevant Linux Features: Control Operator

Control Operator A Control Operator is a token that performs a control function.  It is one of the following symbols: || & && ; ;; ( ) | |& <newline> . We will focus on only && and || control operators in this article. On occasion you might need to group Docker commands. Let's see a few ways to do this in Linux with three of the control operators. Control operators Description ; Semicolon - delimits commands in a sequence Used to run multiple commands one after the other Similar to hitting ENTER after each command: $ docker run --rm -it debian bash -c "ls /var; sleep 1; ls /" Run the container and execute the three commands one after the other, separated by ; (semicolon) && AND - runs commands conditionally, on success has the form A && B where B is run if, and only if A succeeds, i.e. if A returns an exit status o