📄 123-127.html
字号:
<HTML>
<HEAD>
<TITLE>Linux in Plain English:Linux Commands Organized by Group</TITLE>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<!--ISBN=1558285423//-->
<!--TITLE=Linux in Plain English//-->
<!--AUTHOR=Patrick Volkerding//-->
<!--AUTHOR=Kevin Reichard//-->
<!--PUBLISHER=IDG Books Worldwide, Inc.//-->
<!--IMPRINT=M & T Books//-->
<!--CHAPTER=5//-->
<!--PAGES=123-127//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="115-122.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="128-132.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P><FONT SIZE="+1"><B>startx......<TT>Starts X Session</TT></B></FONT></P>
<IMG SRC="images/05-26i.jpg"><P><B>startx</B></P>
<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>
<P>The <B>startx</B> command launches an X Window System session from a Linux command line. It’s really a front end to the <B>xinit</B> command.</P>
<P>When you launch <B>startx</B>, it looks for a file called <B>xinitrc</B> in your home directory. This file contains information about your X Window setup, as well as what clients you want to run in conjunction with your X environment. Most of these clients should run in the background, except for the last client in the list, which should run in the foreground (this is usually a window manager).</P>
<P>Not many settings are associated with this command; you’ll want to check <B>xinit</B> for more information.</P>
<P><FONT SIZE="+1"><B><I>RELATED COMMAND</I></B></FONT></P>
<DL>
<DD><B>xinit</B>
</DL>
<P><FONT SIZE="+1"><B>strace......<TT>Trace System Call</TT></B></FONT></P>
<P><B>strace</B> <I>option(s) command</I></P>
<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>
<P>The <B>strace</B> command is used to trace system calls and signals. You use it to run a specified <I>command</I>; <B>strace</B> then tracks what system calls and signals are used by a process. The resulting information is printed to the screen or to a file (with the <B>-o</B> option). It’s a useful command because you don’t need the source code to see where a command is having problems.</P>
<P><FONT SIZE="+1"><B><I>OPTIONS</I></B></FONT></P>
<TABLE WIDTH="100%">
<TR>
<TD WIDTH="25%" VALIGN="TOP"><B>-a<I>column</I></B>
<TD WIDTH="75%">Aligns in a specific number of columns.
<TR>
<TD VALIGN="TOP"><B>-c</B>
<TD>Counts time, calls, and errors for each system call and reports a summary.
<TR>
<TD><B>-d</B>
<TD>Shows some debugging output of <B>strace</B> itself.
<TR>
<TD><B>-eabbrev=<I>set</I></B>
<TD>Abbreviates the output from large structures.
<TR>
<TD VALIGN="TOP"><B>-eraw=<I>set</I></B>
<TD>Prints undecoded (hexadecimal) arguments for the specifed set of system calls.
<TR>
<TD VALIGN="TOP"><B>-eread=<I>set</I></B>
<TD>Prints all hexadecimal and ASCII information of the specified set.
<TR>
<TD><B>-esignal=<I>set</I></B>
<TD>Traces only the specified subset of signals.
<TR>
<TD><B>-etrace=<I>set</I></B>
<TD>Traces only <I>set</I> of system calls.
<TR>
<TD VALIGN="TOP"><B>-everbose=<I>set</I></B>
<TD>Dereferences structures for the specified set of system calls.
<TR>
<TD><B>-f</B>
<TD>Traces child processes.
<TR>
<TD VALIGN="TOP"><B>-i</B>
<TD>Prints the instruction pointer at the time of the system call.
<TR>
<TD><B>-o<I>filename</I></B>
<TD>Writes the output to <I>filename</I>.
<TR>
<TD VALIGN="TOP"><B>-O <I>overhead</I></B>
<TD>Set the overhead for tracing system calls to <I>overhead</I> microseconds.
<TR>
<TD><B>-p<I>pid</I></B>
<TD>Attaches to the process <I>pid</I> and begin tracing.
<TR>
<TD><B>-q</B>
<TD>Suppresses messages.
<TR>
<TD VALIGN="TOP"><B>-r</B>
<TD>Prints a relative timestamp upon entry to each system call.
<TR>
<TD><B>-s <I>strsize</I></B>
<TD>Sets the maximum string size to print (the default is 32).
<TR>
<TD VALIGN="TOP"><B>-S<I>sortby</I></B>
<TD>Sort the output of the output from the <B>-c</B> option by <I>sortby</I>.
<TR>
<TD><B>-t</B>
<TD>Begins each line of the trace with the time of day.
<TR>
<TD VALIGN="TOP"><B>-tt</B>
<TD>Begins each line of the trace with the time of day, including microseconds.
<TR>
<TD><B>-T</B>
<TD>Returns the time spent in system calls.
<TR>
<TD><B>-v</B>
<TD>Provides verbose output.
<TR>
<TD VALIGN="TOP"><B>-x</B>
<TD>Prints non-ASCII strings in hexadecimal string format.
<TR>
<TD><B>-xx</B>
<TD>Print all strings in hexadecimal string format.
</TABLE>
<P><FONT SIZE="+1"><B><I>RELATED COMMANDS</I></B></FONT></P>
<DL>
<DD><B>ptrace
<DD>time
<DD>trace</B>
</DL>
<P><FONT SIZE="+1"><B>strings......<TT>Find Strings</TT></B></FONT></P>
<P><B>strings</B> <I>option(s) filename(s)</I></P>
<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>
<P>The <B>strings</B> command searches for printable strings in a file. By default, a string must be at least four characters in length before being displayed. This command is usually used to search for printable text in binary files.</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>NOTE: </B>Most Linux implementations contain two versions of <B>strings</B>: the original UNIX version (<B>strings</B>) and the GNU version (<B>strings-gnu</B>), which is a more advanced version.<HR></FONT>
</BLOCKQUOTE>
<P><FONT SIZE="+1"><B><I>OPTIONS</I></B></FONT></P>
<TABLE WIDTH="100%">
<TR>
<TD WIDTH="25%" VALIGN="TOP"><B>-a</B>
<TD WIDTH="75%">Searches through an entire object file for strings. The default is to search only the text and data segments of an object file.
<TR>
<TD VALIGN="TOP"><B>-f</B>
<TD>Prints the name of the file containing the string, as well as the string itself.
<TR>
<TD VALIGN="TOP"><B>-n <I>num</I></B>
<TD>Sets the minimum number of characters in a string to <I>num</I>, instead of the default four.
<TR>
<TD VALIGN="TOP"><B>-o</B>
<TD>Prints the decimal offset of the string within the file, as well as the string itself.
</TABLE>
<P><FONT SIZE="+1"><B><I>RELATED COMMANDS</I></B></FONT></P>
<DL>
<DD><B>hexdump
<DD>strings-gnu</B>
</DL>
<P><FONT SIZE="+1"><B>strings-gnu......<TT>Find Strings</TT></B></FONT></P>
<IMG SRC="images/05-27i.jpg"><P><B>strings</B> <I>option(s) filename(s)</I></P>
<P><FONT SIZE="+1"><B><I>PURPOSE</I></B></FONT></P>
<P>The <B>strings</B> command searches for printable strings in a file. By default, a string must be at least four characters in length before being displayed. This command is usually used to search for printable text in binary files.</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>NOTE: </B>Most Linux implementations contain two versions of <B>strings</B>: the original UNIX version (<B>strings</B>) and the GNU version (<B>strings-gnu</B>), which is a more advanced version.<HR></FONT>
</BLOCKQUOTE>
<P><FONT SIZE="+1"><B><I>OPTIONS</I></B></FONT></P>
<TABLE WIDTH="100%">
<TR>
<TD WIDTH="30%" VALIGN="TOP"><B>-a</B>
<TD WIDTH="70%">Searches through an entire object file for strings. The default is to search only the text and data segments of an object file.
<TR>
<TD VALIGN="TOP"><B>-f</B>
<TD>Prints the name of the file containing the string, as well as the string itself.
<TR>
<TD VALIGN="TOP"><B>-n <I>num</I></B>
<TD>Sets the minimum number of characters in a string to <I>num</I>, instead of the default four.
<TR>
<TD VALIGN="TOP"><B>-o</B>
<TD>Prints the decimal offset of the string within the file, as well as the string itself.
<TR>
<TD VALIGN="TOP"><B>-t {<I>o,x,d</I>}</B>
<TD>Prints the decimal offset of the string within the file, as well as the string itself. The single character argument specifies the radix of the offset–octal, hexadecimal, or decimal.
<TR>
<TD VALIGN="TOP"><B>—target=<I>bfdname</I></B>
<TD>Specifies an object code format other than your system’s default format.
</TABLE>
<P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="115-122.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="128-132.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -