I can't find a way to vertically center a single line within a table cell.
Take a look at this screenshoot:
I'd like to vertically center the text within the bottom right cell and I just can't find a way to do it. I tried \usepackage{array}
but I couldn't figure out how to apply the \centering\arraybackslash
, which seems to align things vertically within cells, just to this single cell.
(I'm also not sure why the right border is missing for this cell.)
Here is the LaTeX code that generates this table:
\documentclass{article}
\usepackage[left=1cm,top=1cm,right=1cm,bottom=1cm,nohead,nofoot]{geometry}
\usepackage[pdftex]{hyperref}
\usepackage{verbatim}
\usepackage{listings}
\usepackage{array}
\hypersetup{colorlinks}
\lstset{basicstyle=\ttfamily}
\pagestyle{empty}
% -----------------------------------------------------------------------
\begin{document}
\begin{tabular}{|p{5.5cm}|p{12.2cm}|}
\hline
\large\textbf{Redirection} & \large\textbf{Description} \\
\hline
\verb|> file| & Redirect standard output (stdout) to a file. \\
\hline
\verb|1> file| & Same as \verb|> file|. \verb|1| is the default file descriptor for stdout. \\
\hline
\verb|2> file| & Redirect standard error (stderr) to a file. \verb|2| is the default file descriptor for stderr. \\
\hline
\verb|>> file| & Append stdout to a file. \\
\hline
\verb|2>> file| & Append stderr to a file. \\
\hline
\verb|&> file| & Redirect stdout and stderr to a file. \\
\hline
\verb|>file 2>&1| & Another way to redirect both stdout and stderr to a file. This \textbf{is not} the same as \verb|2>&1 >file|. \textbf{Redirection order matters!} \\
\hline
\verb|> /dev/null| & Discard stdout. \\
\hline
\verb|2> /dev/null| & Discard stderr. \\
\hline
\verb|&> /dev/null| & Discard stdout and stderr. \\
\hline
\verb|< file| & Redirect the contents of the file to the stdin. \\
\hline
\verb|<< EOL| \\
\verb|foo| \\
\verb|bar| \\
\verb|baz| \\
\verb|EOL| & Redirect a bunch of lines to the stdin. \\
\hline
\end{tabular}
\end{document}
\documentclass... .....\end{document}