-.TH FUSER 1 "September 26, 2003" "Linux" "User Commands"
+.TH FUSER 1 2004-11-09 "Linux" "User Commands"
.SH NAME
fuser \- identify processes using files or sockets
.SH SYNOPSIS
.RB [ \-n\ \fIspace ]
.RB [ \-k
.RB [ \-i ]
-.RB [ \-\fIsignal\fR ]
+.RB [ \-\fIsignal\fR ]
]
.RB [ \-muvf ]
.I name ...
.br
-.B fuser
+.B fuser
.RB \-l
.br
-.B fuser
+.B fuser
.RB \-V
.ad b
.SH DESCRIPTION
found, \fBfuser\fP returns zero.
.PP
In order to look up processes using TCP and UDP sockets, the corresponding
-name space has to be selected with the \fB-n\fP option. By default
-\fBfuser\fP will look in both IPv6 and IPv4 sockets. To change the default,
-behavour, use the \fB-4\fP and \fB-6\fP options. The socket(s) can
+name space has to be selected with the \fB\-n\fP option. By default
+\fBfuser\fP will look in both IPv6 and IPv4 sockets. To change the default,
+behavour, use the \fB\-4\fP and \fB\-6\fP options. The socket(s) can
be specified by the local and remote port, and the remote address. All fields
are optional, but commas in front of missing fields must be present:
.IP \fB\-f\fP
Silently ignored, used for POSIX compatibility.
.IP \fB\-k\fP
-Kill processes accessing the file. Unless changed with \fB-\fP\fIsignal\fP,
+Kill processes accessing the file. Unless changed with \fB\-\fP\fIsignal\fP,
SIGKILL is sent. An \fBfuser\fP process never kills itself, but may kill
other \fBfuser\fP processes. The effective user ID of the process executing
\fBfuser\fP is set to its real user ID before attempting to kill.
.IP \fB\-n\ \fIspace\fP
Select a different name space. The name spaces \fBfile\fP (file names, the
default), \fBudp\fP (local UDP ports), and \fBtcp\fP (local TCP ports) are
-supported. For ports, either the port number or the symbolic name can be
+supported. For ports, either the port number or the symbolic name can be
specified. If there is no ambiguity, the shortcut notation
\fIname\fB/\fIspace\fP (e.g. \fIname\fB/\fIproto\fP) can be used.
.IP \fB\-s\fP
.IP \fB\-\fIsignal\fP
Use the specified signal instead of SIGKILL when killing processes. Signals
can be specified either by name (e.g. \fB\-HUP\fP) or by number
-(e.g. \fB\-1\fP). This option is silently ignored if the \fB\-k\fP option
+(e.g. \fB\-1\fP). This option is silently ignored if the \fB\-k\fP option
is not used.
.IP \fB\-u\fP
Append the user name of the process owner to each PID.
.IP \fB\-V\fP
Display version information.
.IP \fB\-4\fP
-Search only for IPv4 sockets. This option must not be used with the
-\fB-6\fP option and only has an effect with the tcp and udp namespaces.
+Search only for IPv4 sockets. This option must not be used with the
+\fB\-6\fP option and only has an effect with the tcp and udp namespaces.
.IP \fB\-6\fP
-Search only for IPv6 sockets. This option must not be used with the \fB-4\fP
+Search only for IPv6 sockets. This option must not be used with the \fB\-4\fP
option and only has an effect with the tcp and udp namespaces.
.IP \fB\-\fP
Reset all options and set the signal back to SIGKILL.
/proc location of the proc file system
.fi
.SH EXAMPLES
-\fBfuser -km /home\fP kills all processes accessing the file system /home
+\fBfuser \-km /home\fP kills all processes accessing the file system /home
in any way.
.LP
-\fBif fuser -s /dev/ttyS1; then :; else \fIsomething\fP; fi\fR invokes
+\fBif fuser \-s /dev/ttyS1; then :; else \fIsomething\fP; fi\fR invokes
\fIsomething\fP if no other process is using /dev/ttyS1.
.LP
\fBfuser telnet/tcp\fP shows all processes at the (local) TELNET port.
\fBudp\fP and \fBtcp\fP currently work with IPv6 and IPv4, but the
address fields can only be IPv4 addresses.
.PP
-Accesses by the kernel are only shown with the \fB-v\fP option.
+Accesses by the kernel are only shown with the \fB\-v\fP option.
.PP
-The \fB-k\fP option only works on processes. If the user is the kernel,
+The \fB\-k\fP option only works on processes. If the user is the kernel,
\fBfuser\fP will print an advice, but take no action beyond that.
.SH BUGS
.PP
-fuser -m /dev/sgX will show (or kill with the -k flag) all processes, even
-if you don't have that device configured. There may be other devices it
+fuser \-m /dev/sgX will show (or kill with the \-k flag) all processes, even
+if you don't have that device configured. There may be other devices it
does this for too.
.SH AUTHORS
.PP
.PP
Craig Small <csmall@small.dropbear.id.au>
.SH "SEE ALSO"
-kill(1), killall(1), lsof(8), ps(1), kill(2)
+.BR kill "(1), " killall "(1), " lsof "(8), " ps "(1), " kill (2).
.\"{{{}}}
-.TH KILLALL 1 "September 26, 2003" "Linux" "User Commands"
+.TH KILLALL 1 2004-11-09 "Linux" "User Commands"
.SH NAME
killall \- kill processes by name
.SH SYNOPSIS
.ad l
.B killall
.RB [ \-d , \-\-sid ]
-.RB [ \-c , \-\-context ]
-.RB [ \-e , --exact ]
-.RB [ \-g , \-\-process-group ]
+.RB [ \-c , \-\-context ]
+.RB [ \-e , \-\-exact ]
+.RB [ \-g , \-\-process\-group ]
.RB [ \-i , \-\-interactive ]
.RB [ \-q , \-\-quiet ]
-.RB [ \-s , \-\-signal
+.RB [ \-s , \-\-signal
.IR signal ]
.RB [ \-v , \-\-verbose ]
.RB [ \-w , \-\-wait ]
signal name is specified, SIGTERM is sent.
.PP
Signals can be specified either by name (e.g. \fB\-HUP\fP) or by number
-(e.g. \fB\-1\fP).
+(e.g. \fB\-1\fP).
.PP
If the command name contains a slash (\fB/\fP), processes executing that
particular file will be selected for killing, independent of their name.
.PP
-\fBkillall\fP returns a zero return code if at least one process has been
+\fBkillall\fP returns a zero return code if at least one process has been
killed for each listed command. \fBkillall\fP returns non-zero otherwise.
.PP
A \fBkillall\fP process never kills itself (but may kill other \fBkillall\fP
than 15 characters, the full name may be unavailable (i.e. it is swapped
out). In this case, \fBkillall\fP will kill everything that matches within
the first 15 characters. With \fB\-e\fP, such entries are skipped.
-\fBkillall\fP prints a message for each skipped entry
+\fBkillall\fP prints a message for each skipped entry
if \fB\-v\fP is specified in addition to \fB\-e\fP,
-.IP "\fB\-I\fP, \fB\-\-ignore-case\fP"
+.IP "\fB\-I\fP, \fB\-\-ignore\-case\fP"
Do case insensitive process name match.
-.IP "\fB\-g\fP, \fB\-\-process-group\fP"
+.IP "\fB\-g\fP, \fB\-\-process\-group\fP"
Kill the process group to which the process belongs. The kill signal is only
sent once per group, even if multiple processes belonging to the same process
group were found.
effect, or if the process stays in zombie state.
.IP \fB\-d\fP
(Flask only) Specify SID: kill only processes with given SID. Mutually exclusive
-with \fB-c\fP argument. Must precede other arguments on command line.
+with \fB\-c\fP argument. Must precede other arguments on command line.
.IP \fB\-c\fP
-(Flask only) Specify security context: kill only processes with given security context.
-Mutually exclusive with \fB-d\fP. Must precede other arguments on the command line.
+(Flask only) Specify security context: kill only processes with given security
+context. Mutually exclusive with \fB\-d\fP. Must precede other arguments on
+the command line.
.SH FILES
.nf
/proc location of the proc file system
a new process with the same PID between scans.
.SH AUTHORS
Werner Almesberger <werner@almesberger.net> wrote the original version
-of psmisc. Since version 20 Craig Small <csmall@small.dropbear.id.au>
+of psmisc. Since version 20 Craig Small <csmall@small.dropbear.id.au>
can be blamed.
.SH "SEE ALSO"
-.BR kill (1), fuser (1), pgrep (1), pidof (1), pkill (1), ps (1), kill (2)
+.BR kill "(1), " fuser "(1), " pgrep "(1), " pidof "(1), " pkill "(1), "
+.BR ps "(1), " kill (2).
.\"{{{}}}
-.TH PSTREE 1 "September 26, 2003" "Linux" "User Commands"
+.TH PSTREE 1 2004-11-09 "Linux" "User Commands"
.SH NAME
pstree \- display a tree of processes
.SH SYNOPSIS
.ad l
-.B pstree
+.B pstree
.RB [ \-a ]
.RB [ \-c ]
.RB [ \-h | \-H \fIpid\fB ]
init\-+\-getty
|\-getty
|\-getty
- `-getty
+ `\-getty
.sp
.fi
becomes
.PP
If \fBpstree\fR is called as \fBpstree.x11\fR then it will prompt the user
at the end of the line to press return and will not return until that
-has happened. This is useful for when \fBpstree\fR is run in a xterminal.
+has happened. This is useful for when \fBpstree\fR is run in a xterminal.
.SH OPTIONS
.IP \fB\-a\fP
its parent, the new uid is shown in parentheses after the process name.
.IP \fB\-U\fP
Use UTF-8 (Unicode) line drawing characters. Under Linux 1.1-54 and above,
-UTF-8 mode is entered on the console with \fBecho -e '\\033%8'\fP and left
-with \fBecho -e '\\033%@'\fP
+UTF-8 mode is entered on the console with \fBecho \-e '\\033%8'\fP and left
+with \fBecho \-e '\\033%@'\fP
.IP \fB\-V\fP
Display version information.
.IP \fB\-s\fP
Werner Almesberger <werner@almesberger.net>
Craig Small <csmall@small.dropbear.id.au>
.SH "SEE ALSO"
-ps(1), top(1)
+.BR ps "(1), " top (1).
.\"{{{}}}
+*.gmo
Makefile.in
Makefile
POTFILES
src/killall.c
src/fuser.c
src/pstree.c
+src/signals.c
#include <linux/kdev_t.h> /* for MKDEV */
#include <linux/major.h> /* for LOOP_MAJOR */
#endif
-#ifdef ENABLE_NLS
-#include <libintl.h>
-#include <locale.h>
-#define _(String) gettext (String)
-#else
-#define _(String) (String)
-#endif
+#include "i18n.h"
#include "comm.h"
#include "loop.h" /* for loop_info */
#include "signals.h"
{
if (header && (file->flags & FLAG_VERB))
{
- fprintf (stderr, _("\n%*s USER PID ACCESS COMMAND\n"), NAME_FIELD, "");
+ fprintf (stderr, _("\n%*s USER PID ACCESS COMMAND\n"),
+ NAME_FIELD, "");
header = 0;
}
length = 0;
{
fprintf(stderr, _("fuser (psmisc) %s\n"), VERSION);
fprintf(stderr, _(
- "Copyright (C) 1993-2002 Werner Almesberger and Craig Small\n\n"
+ "Copyright (C) 1993-2002 Werner Almesberger and Craig Small\n\n"));
+ fprintf(stderr, _(
"PSmisc comes with ABSOLUTELY NO WARRANTY.\n"
- "This is free software, and you are welcome to redistribute it under the terms\n"
- "of the GNU General Public License.\n"
+ "This is free software, and you are welcome to redistribute it under\n"
+ "the terms of the GNU General Public License.\n"
"For more information about these matters, see the files named COPYING.\n"));
}
#include <selinux/fs_secure.h>
#include <selinux/ss.h>
#endif /*FLASK_LINUX*/
-#ifdef ENABLE_NLS
-#include <libintl.h>
-#include <locale.h>
-#define _(String) gettext (String)
-#else
-#define _(String) (String)
-#endif
+#include "i18n.h"
#include "comm.h"
#include "signals.h"
static void
usage_pidof (void)
{
- fprintf (stderr, _("usage: pidof [ -eg ] name ...\n"));
- fprintf (stderr, _(" pidof -V\n\n"));
- fprintf (stderr, _(" -e require exact match for very long names;\n"));
- fprintf (stderr, _(" skip if the command line is unavailable\n"));
- fprintf (stderr,
- _(" -g show process group ID instead of process ID\n"));
- fprintf (stderr, _(" -V display version information\n\n"));
+ fprintf (stderr, _(
+ "usage: pidof [ -eg ] name ...\n"
+ " pidof -V\n\n"
+ " -e require exact match for very long names;\n"
+ " skip if the command line is unavailable\n"
+ " -g show process group ID instead of process ID\n"
+ " -V display version information\n\n"));
}
usage_killall (void)
{
#ifdef FLASK_LINUX
- fprintf(stderr,_("Usage: killall [-s sid] [-c context] [ -egiqvw ] [ -signal ] name ...\n"));
+ fprintf(stderr, _(
+ "usage: killall [-s sid] [-c context] [ -egiqvw ] [ -signal ] name ...\n"));
#else /*FLASK_LINUX*/
- fprintf (stderr, _("usage: killall [ OPTIONS ] [ -- ] name ...\n"));
+ fprintf(stderr, _(
+ "usage: killall [ OPTIONS ] [ -- ] name ...\n"));
#endif /*FLASK_LINUX*/
- fprintf (stderr, _(" killall -l, --list\n"));
- fprintf (stderr, _(" killall -V --version\n\n"));
- fprintf (stderr, _(" -e,--exact require exact match for very long names\n"));
- fprintf (stderr, _(" -I,--ignore-case- case insensitive process name match\n"));
- fprintf (stderr, _(" -g,--process-group kill process group instead of process\n"));
- fprintf (stderr, _(" -i,--interactive ask for confirmation before killing\n"));
- fprintf (stderr, _(" -l,--list list all known signal names\n"));
- fprintf (stderr, _(" -q,--quiet don't print complaints\n"));
- fprintf (stderr, _(" -s,--signal send signal instead of SIGTERM\n"));
- fprintf (stderr, _(" -v,--verbose report if the signal was successfully sent\n"));
- fprintf (stderr, _(" -V,--version display version information\n"));
- fprintf (stderr, _(" -w,--wait wait for processes to die\n\n"));
+ fprintf(stderr, _(
+ " killall -l, --list\n"
+ " killall -V --version\n\n"
+ " -e,--exact require exact match for very long names\n"
+ " -I,--ignore-case case insensitive process name match\n"
+ " -g,--process-group kill process group instead of process\n"
+ " -i,--interactive ask for confirmation before killing\n"
+ " -l,--list list all known signal names\n"
+ " -q,--quiet don't print complaints\n"
+ " -s,--signal send signal instead of SIGTERM\n"
+ " -v,--verbose report if the signal was successfully sent\n"
+ " -V,--version display version information\n"
+ " -w,--wait wait for processes to die\n\n"));
#ifdef FLASK_LINUX
- fprintf (stderr, _(" -d,--sid kill only process(es) having sid\n"));
- fprintf (stderr, _(" -c,--context kill only process(es) having scontext\n"));
- fprintf(stderr, _(" (-s, -c are mutually exclusive and must precede other arguments)\n\n"));
+ fprintf(stderr, _(
+ " -d,--sid kill only process(es) having sid\n"
+ " -c,--context kill only process(es) having scontext\n"
+ " (-s, -c are mutually exclusive and must precede other arguments)\n\n"
+ ));
#endif /*FLASK_LINUX*/
}
void print_version()
{
fprintf(stderr, "%s (psmisc) %s\n", pidof ? "pidof" : "killall", VERSION);
- fprintf(stderr, _("Copyright (C) 1993-2002 Werner Almesberger and Craig Small\n\n"));
- fprintf(stderr, _("PSmisc comes with ABSOLUTELY NO WARRANTY.\n"));
- fprintf(stderr, _("This is free software, and you are welcome to redistribute it under the terms\n"));
- fprintf(stderr, _("of the GNU General Public License.\n"));
- fprintf(stderr, _("For more information about these matters, see the files named COPYING.\n"));
+ fprintf(stderr, _(
+ "Copyright (C) 1993-2002 Werner Almesberger and Craig Small\n\n"));
+ fprintf(stderr, _(
+ "PSmisc comes with ABSOLUTELY NO WARRANTY.\n"
+ "This is free software, and you are welcome to redistribute it under\n"
+ "the terms of the GNU General Public License.\n"
+ "For more information about these matters, see the files named COPYING.\n"));
}
int
lsid = strtol(optarg, buf, 0);
if ( **buf ) {
- (void) fprintf(stderr, _("%s: SID (%s) must be numeric\n"), name, *argv);
+ (void) fprintf(stderr, _("%s: SID (%s) must be numeric\n"),
+ name, *argv);
(void) fflush(stderr);
return( 1 );
}
len = strlen(optarg);
rv = security_sid_to_context(sid, buf, &len);
if ( rv < 0 && (errno != ENOSPC) ) {
- (void) fprintf(stderr, "%s: security_sid_to_context(%d) %s\n", name, (int) sid, strerror(errno));
+ (void) fprintf(stderr, "%s: security_sid_to_context(%d) %s\n",
+ name, (int) sid, strerror(errno));
(void) fflush(stderr);
free(buf);
return( 1 );
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
-#ifdef ENABLE_NLS
-#include <locale.h>
-#include <libintl.h>
-#define _(String) gettext (String)
-#else
-#define _(String) (String)
-#endif
+#include "i18n.h"
#include "comm.h"
#ifdef FLASK_LINUX
static void
usage (void)
{
- fprintf (stderr, _("usage: pstree [ -a ] [ -c ] [ -h | -H pid ] [ -l ] [ -n ] [ -p ] [ -u ]\n"));
- fprintf (stderr, _(" [ -A | -G | -U ] [ pid | user]\n"));
- fprintf (stderr, _(" pstree -V\n\n"));
- fprintf (stderr, _(" -a show command line arguments\n"));
- fprintf (stderr, _(" -A use ASCII line drawing characters\n"));
- fprintf (stderr, _(" -c don't compact identical subtrees\n"));
- fprintf (stderr, _(" -h highlight current process and its ancestors\n"));
- fprintf (stderr, _(" -H pid highlight process \"pid\" and its ancestors\n"));
- fprintf (stderr, _(" -G use VT100 line drawing characters\n"));
- fprintf (stderr, _(" -l don't truncate long lines\n"));
- fprintf (stderr, _(" -n sort output by PID\n"));
- fprintf (stderr, _(" -p show PIDs; implies -c\n"));
- fprintf (stderr, _(" -u show uid transitions\n"));
+ fprintf (stderr, _(
+ "usage: pstree [ -a ] [ -c ] [ -h | -H pid ] [ -l ] [ -n ] [ -p ] [ -u ]\n"
+ " [ -A | -G | -U ] [ pid | user]\n"
+ " pstree -V\n\n"
+ " -a show command line arguments\n"
+ " -A use ASCII line drawing characters\n"
+ " -c don't compact identical subtrees\n"
+ " -h highlight current process and its ancestors\n"
+ " -H pid highlight process \"pid\" and its ancestors\n"
+ " -G use VT100 line drawing characters\n"
+ " -l don't truncate long lines\n"
+ " -n sort output by PID\n"
+ " -p show PIDs; implies -c\n"
+ " -u show uid transitions\n"));
#ifdef FLASK_LINUX
- fprintf (stderr, _(" -s show Flask SIDs\n"));
- fprintf (stderr, _(" -x show Flask security contexts\n"));
+ fprintf (stderr, _(
+ " -s show Flask SIDs\n"
+ " -x show Flask security contexts\n"));
#endif /*FLASK_LINUX*/
- fprintf (stderr, _(" -U use UTF-8 (Unicode) line drawing characters\n"));
- fprintf (stderr, _(" -V display version information\n"));
- fprintf (stderr, _(" pid start at pid, default 1 (init)\n"));
- fprintf (stderr, _(" user show only trees rooted at processes of that user\n\n"));
+ fprintf (stderr, _(
+ " -U use UTF-8 (Unicode)) line drawing characters\n"
+ " -V display version information\n"
+ " pid start at pid, default 1 (init))\n"
+ " user show only trees rooted at processes of that user\n\n"));
exit (1);
}
void print_version()
{
fprintf(stderr, _("pstree (psmisc) %s\n"), VERSION);
- fprintf(stderr, _("Copyright (C) 1993-2002 Werner Almesberger and Craig Small\n\n"));
- fprintf(stderr, _("pstree comes with ABSOLUTELY NO WARRANTY.\n"));
- fprintf(stderr, _("This is free software, and you are welcome to redistribute it under the terms\n"));
- fprintf(stderr, _("of the GNU General Public License.\n"));
- fprintf(stderr, _("For more information about these matters, see the files named COPYING.\n"));
+ fprintf(stderr, _(
+ "Copyright (C) 1993-2002 Werner Almesberger and Craig Small\n\n"));
+ fprintf(stderr, _(
+ "PSmisc comes with ABSOLUTELY NO WARRANTY.\n"
+ "This is free software, and you are welcome to redistribute it under\n"
+ "the terms of the GNU General Public License.\n"
+ "For more information about these matters, see the files named COPYING.\n"));
}
#include <string.h>
#include <ctype.h>
#include <signal.h>
-#ifdef ENABLE_NLS
-#include <libintl.h>
-#include <locale.h>
-#define _(String) gettext (String)
-#else
-#define _(String) (String)
-#endif
+
+#include "i18n.h"
#include "signals.h"