
ps | 355
Linux
Commands
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
printf
printf formats [strings]
printf option
Print strings using the specified formats. formats can be ordinary
text characters, C-language escape characters, C format specifica-
tions ending with one of the letters diouxXfeEgGcs or, more
commonly, a set of conversion arguments listed here.
Options
--help
Print usage information and exit.
--version
Print version information and exit.
Arguments
%% Print a single %.
%b Print string with \ escapes interpreted.
%s Print the next string.
%n$s
Print the nth string.
%[-]m[.n]s
Print the next string, using a field that is m characters wide.
Optionally, limit the field to print only the first n characters of
string. Strings are right-adjusted unless the left-adjustment
flag, -, is specified.
Examples
printf '%s %s\n' "My files are in" $HOME
printf '%-25.15s %s\n' "My files are in" $HOME
ps
ps [options]
Report on active processes. ps has three types of options. GNU
long options start with two hyphens, which are required. BSD
options may be grouped and do not start with a hyphen, while
Unix98 options may be grouped and require an initial hyphen. The
meaning of the short options can vary depending on whether or
not there is a hyphen. In options, list arguments should either be
comma-separated or space-separated and placed inside double
quotes. ...