Reference list

Helpful references

Unix Commands

$(CMD):

Command substitution

$?:

Get exit code from last command

$VAR:

Get value of variable

aclocal:

Generate M4 library necessary for processing configure.ac

autoconf:

Generate a project configuration script by processing configure.ac

autoheader:

Generate a config.h.in by processing configure.ac

automake:

Generate Makefile template(s) by processing configure.ac and Makefile.am (s)

bg:

Place suspended command into background

cat:

Concatenate files and print the result (or print a single file)

cd:

Change the working directory

CMD 1 ; CMD 2 :

Delimit commands

CMD 1 | CMD 2 :

Pipe output from one command into the input of another

CMD &:

Run command in background

CMD >FILE:

Redirect output from command to file

CMD <FILE:

Use contents of file as input to command

configure:

A script generated by autoconf; inspects system, and generates config.h and Makefile (s)

cp:

Copy a file

Crtl-R:

Search for previous command in history

Ctrl-Z:

Suspend command running in foreground

diff:

Compare files line-by-line

echo:

Display given text

env:

Display the current environment variables

export VAR:

Mark variable as exportable to the environment of run commands

fg:

Bring background command into foreground

find:

Search for files in a directory hierarchy

(gdb) backtrace:

Print a backtrace

(gdb) ba:

Print a backtrace

(gdb) break:

Set a break point

(gdb) break:

Set a break point, which causes execution to stop a some point in the program

(gdb) continue:

Continue execution after breaking

(gdb) disassemble:

Disassemble a block of instructions

(gdb) next:

Execute the next statement in the program, but do not enter functions

(gdb) print:

Print a value

(gdb) quit:

Quit

(gdb) run:

Run program you have loaded in GDB

(gdb) step:

Execute the next statement in the program, entering functions when they occur

(gdb) stepi:

Step forward one instruction

(gdb) x:

Examine the contents of memory

git add:

Designate one or more files as part of the next commit

git clone:

Make a local copy of a Git repository

git commit:

Perform a commit and record an associated message

git diff:

Display the changes made since the last commit

git format-patch:

Prepare patches for email submission

git log:

Print the history of commits to a project

git push:

Push committed changes back to the original repository

git reset:

Reset Git repository to a previous state

gpg:

Perform cryptographic operations such as encrypting and signing

grep:

Print only lines that match a regular expression

gzip:

Compress a file

history:

Display the command history

history:

Print command history

if CMD 1 ; then CMD 2 ; fi:

Conditional

john:

A password cracker

kill:

Send a signal to a process

ldd:

Print shared object dependencies

ls:

List directory contents

ltrace:

A library-call tracer

mail:

Send and receive Internet mail

make:

Build and otherwise maintain groups of programs

man:

Display a Unix manual page

mkdir:

Create a directory

mv:

Move (rename) a file

nc (netcat):

Concatenate and redirect sockets

objdump:

Display information about object files, including disassembly

openssl genrsa:

generate an RSA private key

openssl req:

process X.509 certificate-signing requests

openssl x509:

process X.509 certificates

patch:

Apply a diff file to an original

podman build:

Build a container image defined by a Dockerfile

podman images:

List the container images on the local host

podman pull:

Pull a container image from a known repository

podman run:

Establish a container and load an image

ps:

Display the current processes

pstree:

Display a tree of processes

pwd:

Print working directory

rmdir:

Permanently remove an empty directory

rm:

Permanently remove a file

scp:

Secure copy

sed:

Stream editor for filtering and transforming text

sha256sum:

Compute the SHA-256 hash of a file

sleep:

Delay for a specified amount of time

sshfs:

SSH filesystem client

ssh:

Secure shell

strace:

A system-call tracer

sudo:

Execute a command as another user

su:

Switch user

tar:

an archiving utility

troff:

process troff markup to generate a document

Up/Down Arrow:

Recall previous commands

VAR=$(CMD):

Capture output of command into variable

VAR=VAL:

Set value of variable

wc:

Count the lines, words, or characters in a file

wget:

Download a file identified by a Uniform Resource Locator (URL)

while CMD 1 ; do CMD 2 ; done:

Loop

*:

Wildcard

C Elements

argc:

An integer indicating the number of command-line arguments received by the program

argv:

An array of pointers to the program’s command-line arguments

char:

A single-byte type capable of holding a character, e.g., ‘a’, ‘g’, or ‘Z’

else:

Execute the following block when the previous if did not execute

float:

A floating-point type that approximates a real number

foo[n] = 42:

Set the nth element of the array foo to the value 42

for:

Iterates until a condition is no longer met

for:

Loop with initialization, condition, and increment

getopt:

Parse command-line options

if:

Conditionally execute the following block

int:

An integer type from n to n 1

t foo[] = { 1, 2, 3, 4, 5 }:

Create an array named foo with given values

t foo[n]:

Create an array named foo of n objects of type t

+:

The addition operator

=:

The assignment operator

/:

The division operator

%:

The modulus (remainder) operator

*:

The multiplication operator

-:

The subtraction operator

while:

Repeat the following block as long as a command succeeds

Go Elements

char:

A single-byte type capable of holding a character, e.g., ‘a’, ‘g’, or ‘Z’

else:

Execute the following block when the previous if did not execute

float:

A floating-point type that approximates a real number

for:

Establish a loop

for:

Iterates until a condition is no longer met

if:

Conditionally execute the following block

int:

An integer type from n to n 1

os.Args:

A slice of command-line arguments

+:

The addition operator

=:

The assignment operator

/:

The division operator

%:

The modulus (remainder) operator

*:

The multiplication operator

-:

The subtraction operator

Java Elements

a.length:

The length of the array a

&&:

And logical operator

args:

An array of command-line arguments

char:

A single-byte type capable of holding a character, e.g., ‘a’, ‘g’, or ‘Z’

double:

A floating-point type that approximates a real number

else:

Execute the following block when the previous if did not execute

==:

Equal relational operator

foo[n] = 42:

Set the nth element of the array foo to the value 42

for:

Iterates until a condition is no longer met

for:

Loop with initialization, condition, and increment

if:

Conditionally execute the following block

int:

An integer type from n to n 1

int foo[] = { 1, 2, 3, 4, 5 }:

Create an array named foo with given values

java.net.Socket:

A client socket class able to send or receive communication messages

JButton:

A button widget that reacts to clicks or presses

JFrame:

A window

JLabel:

Display area for a short text string, an image, or both

JPanel:

Generic lightweight container

JTextField:

A field that accepts text input

Math.PI:

An approximation of the value of π

!=:

Not equal relational operator

!:

Not logical operator

||:

Or logical operator

>=:

Greater than or equal to relational operator

>:

Greater than relational operator

<=:

Less than or equal to relational operator

<:

Less than relational operator

t foo[] = new t[n]:

Create an array named foo of n objects of type t

+:

The addition operator

=:

The assignment operator

/:

The division operator

%:

The modulus (remainder) operator

*:

The multiplication operator

-:

The subtraction operator

Timer:

A timer that produces an action event when it expires

while:

Repeat the following block as long as an expression evaluates to true

Python Elements

elif:

Conditionally execute the following block, but only when the previous if did not execute

else:

Execute the following block when the previous if did not execute

for:

Execute command for each element in list

for:

Iterates over the elements of a sequence

if:

Conditionally execute the following block

sys.argv:

An array of command-line arguments

+:

The addition operator

=:

The assignment operator

/:

The division operator

//:

The integer division operator

%:

The modulus (remainder) operator

*:

The multiplication operator

-:

The subtraction operator

while:

Repeat the following block as long as a command succeeds

C Functions

closedir:

Close a directory

connect:

Connect a socket to an address

crypt:

irreversibly hash phrase for storage in the system password database

dlsym:

Obtain address of a symbol in a shared object or executable

dup2:

Duplicate a file descriptor

execvp:

Execute a file

exit:

Terminate the current process

fgetspent:

returns a pointer to the next entry in the shadow password database

fork:

Create a new process by duplicating the calling process

freeaddrinfo:

Free the address object provided from a getaddrinfo call

fscanf:

Read formatted values from a file pointer

gai_strerror:

Print the error string associated with a failed getaddrinfo call

getaddrinfo:

Obtain one or more addresses for a host

isalpha:

Determine whether the given value represents an alphabetic character

opendir:

Open a directory

pipe:

Create pipe

printf:

Print to standard output with formatting

readdir:

Read the next entry in the given directory

recv:

Receive a message from a connected socket

scanf:

Read formatted values from standard input

socket:

Return a socket abstraction able to send or receive communication messages

sscanf:

Read formatted values from a string

strcmp:

Compare two strings

strstr:

Search for the occurrence of one string in another

tolower:

Convert a capital letter to lower-case; return lower-case letter unchanged

waitpid:

Wait for a process to change state

wait:

Wait for a child process to stop or terminate

Go Functions

bufio.NewReader:

Create a buffered reader from a non-buffered reader such as a connection

bufio.Reader.ReadString:

Read up to and including the first occurrence of a delimiting string

fmt.Fscanf:

Read formatted values from a reader

fmt.Printf:

Print to standard output with formatting

fmt.Println:

Print to standard output

fmt.Scanf:

Read formatted values from standard input

fmt.Sscanf:

Read formatted values from a string

ioutil.ReadDir:

Return a list of info structures for a directory’s contents

net.Dial:

Create a connection to the given address

Java methods

Character.isLetter:

Determine whether the given value represents an alphabetic character

Character.toLowerCase:

Convert a capital letter to lower-case; return lower-case letter unchanged

DirectoryStream:

Iterate the elements in a directory

Double.parseDouble:

Returns a double initialized to the value represented by the specified String

Integer.parseInt:

Returns an int initialized to the value represented by the specified String

java.util.Scanner:

Read values from text

Math.pow:

Raise one value to the power of another

Scanner.nextLine:

Read a line from standard input, but drop the terminating newline

String.contains:

Search for the occurrence of one string in another

String.equals:

Compare two strings

System.out.printf:

Print to standard output with formatting

System.out.println:

Print to standard output

Python Functions

context.connect:

Establish a TLS connection using the context’s underlying socket

context.load_cert_chain:

Load a certificate chain for client-side authentication

context.recv:

Receive bytes from TLS connection

context.sendall:

Send bytes on TLS connection

context.wrap_socket:

Wrap a socket in a TLS session

os.listdir:

Return a list containing the names of the entries in the directory given by path.

print:

Print to standard output

socket.socket:

Return a socket abstraction able to send or receive communication messages

SocketType.connect:

Connect a SocketType object to an address

SocketType.recv:

Receive a message from a connected SocketType object

ssl.create_default_context:

Create a new SSL (TLS) object context with the given settings

References