📄 ch16_01.htm
字号:
<HTML><!--Distributed by F --><HEAD><TITLE>[Chapter 16] Where Did I Put That?</TITLE><METANAME="DC.title"CONTENT="UNIX Power Tools"><METANAME="DC.creator"CONTENT="Jerry Peek, Tim O'Reilly & Mike Loukides"><METANAME="DC.publisher"CONTENT="O'Reilly & Associates, Inc."><METANAME="DC.date"CONTENT="1998-08-04T21:37:34Z"><METANAME="DC.type"CONTENT="Text.Monograph"><METANAME="DC.format"CONTENT="text/html"SCHEME="MIME"><METANAME="DC.source"CONTENT="1-56592-260-3"SCHEME="ISBN"><METANAME="DC.language"CONTENT="en-US"><METANAME="generator"CONTENT="Jade 1.1/O'Reilly DocBook 3.0 to HTML 4.0"><LINKREV="made"HREF="mailto:online-books@oreilly.com"TITLE="Online Books Comments"><LINKREL="up"HREF="part03.htm"TITLE="III. Working with the Filesystem "><LINKREL="prev"HREF="ch15_10.htm"TITLE="15.10 Wildcards that Match Only Directories "><LINKREL="next"HREF="ch16_02.htm"TITLE="16.2 Finding Oldest or Newest Files with ls -t and ls -u "></HEAD><BODYBGCOLOR="#FFFFFF"TEXT="#000000"><DIVCLASS="htmlnav"><H1><IMGSRC="gifs/smbanner.gif"ALT="UNIX Power Tools"USEMAP="#srchmap"BORDER="0"></H1><MAPNAME="srchmap"><AREASHAPE="RECT"COORDS="0,0,466,58"HREF="index.htm"ALT="UNIX Power Tools"><AREASHAPE="RECT"COORDS="467,0,514,18"HREF="jobjects/fsearch.htm"ALT="Search this book"></MAP><TABLEWIDTH="515"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch15_10.htm"TITLE="15.10 Wildcards that Match Only Directories "><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 15.10 Wildcards that Match Only Directories "BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><B><FONTFACE="ARIEL,HELVETICA,HELV,SANSERIF"SIZE="-1">Chapter 16</FONT></B></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch16_02.htm"TITLE="16.2 Finding Oldest or Newest Files with ls -t and ls -u "><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 16.2 Finding Oldest or Newest Files with ls -t and ls -u "BORDER="0"></A></TD></TR></TABLE> <HRALIGN="LEFT"WIDTH="515"TITLE="footer"></DIV><DIVCLASS="CHAPTER"><H1CLASS="chapter"><ACLASS="title"NAME="UPT-CHP-16">16. Where Did I Put That?</A></H1><DIVCLASS="htmltoc"><P><B>Contents:</B><BR><ACLASS="sect1"HREF="#UPT-ART-4850"TITLE="16.1 Everything but the find Command ">Everything but the find Command </A><BR><ACLASS="sect1"HREF="ch16_02.htm"TITLE="16.2 Finding Oldest or Newest Files with ls -t and ls -u ">Finding Oldest or Newest Files with ls -t and ls -u </A><BR><ACLASS="sect1"HREF="ch16_03.htm"TITLE="16.3 Reordering ls Listings ">Reordering ls Listings </A><BR><ACLASS="sect1"HREF="ch16_04.htm"TITLE="16.4 List All Subdirectories with ls -R ">List All Subdirectories with ls -R </A><BR><ACLASS="sect1"HREF="ch16_05.htm"TITLE="16.5 The Three UNIX File Times ">The Three UNIX File Times </A><BR><ACLASS="sect1"HREF="ch16_06.htm"TITLE='16.6 clf, cls: "Compressed" ls Listings'>clf, cls: "Compressed" ls Listings</A><BR><ACLASS="sect1"HREF="ch16_07.htm"TITLE="16.7 ls Shortcuts: ll, lf, lg, etc. ">ls Shortcuts: ll, lf, lg, etc. </A><BR><ACLASS="sect1"HREF="ch16_08.htm"TITLE="16.8 The ls -d Option ">The ls -d Option </A><BR><ACLASS="sect1"HREF="ch16_09.htm"TITLE="16.9 An Alias to List Recently Changed Files ">An Alias to List Recently Changed Files </A><BR><ACLASS="sect1"HREF="ch16_10.htm"TITLE="16.10 findcmd: Find a Command in Your Search Path ">findcmd: Find a Command in Your Search Path </A><BR><ACLASS="sect1"HREF="ch16_11.htm"TITLE="16.11 Showing Hidden Files with ls -A and -a ">Showing Hidden Files with ls -A and -a </A><BR><ACLASS="sect1"HREF="ch16_12.htm"TITLE="16.12 Useful ls Aliases ">Useful ls Aliases </A><BR><ACLASS="sect1"HREF="ch16_13.htm"TITLE="16.13 Can't Access a File? Look for Spaces in the Name ">Can't Access a File? Look for Spaces in the Name </A><BR><ACLASS="sect1"HREF="ch16_14.htm"TITLE="16.14 Showing Non-Printable Characters in Filenames ">Showing Non-Printable Characters in Filenames </A><BR><ACLASS="sect1"HREF="ch16_15.htm"TITLE="16.15 Script with a :-) for UNIX Converts: dir, ..., ... ">Script with a :-) for UNIX Converts: dir, ..., ... </A><BR><ACLASS="sect1"HREF="ch16_16.htm"TITLE="16.16 Picking a Unique Filename Automatically ">Picking a Unique Filename Automatically </A><BR><ACLASS="sect1"HREF="ch16_17.htm"TITLE="16.17 Getting Directory Name from a File's Pathname ">Getting Directory Name from a File's Pathname </A><BR><ACLASS="sect1"HREF="ch16_18.htm"TITLE="16.18 Listing Files You've Created/Edited Today ">Listing Files You've Created/Edited Today </A><BR><ACLASS="sect1"HREF="ch16_19.htm"TITLE="16.19 stree: Simple Directory Tree ">stree: Simple Directory Tree </A><BR><ACLASS="sect1"HREF="ch16_20.htm"TITLE="16.20 The vtree Visual Directory Tree Programs ">The vtree Visual Directory Tree Programs </A><BR><ACLASS="sect1"HREF="ch16_21.htm"TITLE="16.21 Finding All Directories with the Same Name ">Finding All Directories with the Same Name </A><BR><ACLASS="sect1"HREF="ch16_22.htm"TITLE="16.22 Comparing Two Directory Trees with dircmp ">Comparing Two Directory Trees with dircmp </A><BR><ACLASS="sect1"HREF="ch16_23.htm"TITLE="16.23 Comparing Filenames in Two Directory Trees ">Comparing Filenames in Two Directory Trees </A><BR><ACLASS="sect1"HREF="ch16_24.htm"TITLE="16.24 Counting Files by Types ">Counting Files by Types </A><BR><ACLASS="sect1"HREF="ch16_25.htm"TITLE="16.25 Listing Files by Age and Size ">Listing Files by Age and Size </A><BR><ACLASS="sect1"HREF="ch16_26.htm"TITLE="16.26 Finding Text Files with findtext ">Finding Text Files with findtext </A><BR><ACLASS="sect1"HREF="ch16_27.htm"TITLE="16.27 newer: Print the Name of the Newest File ">newer: Print the Name of the Newest File </A><BR><ACLASS="sect1"HREF="ch16_28.htm"TITLE="16.28 oldlinks: Find Unconnected Symbolic Links ">oldlinks: Find Unconnected Symbolic Links </A><BR><ACLASS="sect1"HREF="ch16_29.htm"TITLE="16.29 sls: Super ls with Format You Can Choose ">sls: Super ls with Format You Can Choose </A></P><P></P></DIV><DIVCLASS="sect1"><H2CLASS="sect1"><ACLASS="title"NAME="UPT-ART-4850">16.1 Everything but the find Command </A></H2><PCLASS="para">A computer isn't that much different from a house or an office; unlessyou're incredibly orderly, you spend a lot of time looking for thingsthat you've misplaced. Even if you are incredibly orderly, you stillspend some time looking for things you need - you just have a betteridea of where to find them. After all, librarians don't memorizethe location of every book in the stacks, but they do know howto find any book, quickly and efficiently, using whatever tools areavailable. A key to becoming a proficient user of any system, then,is knowing how to find things.</P><PCLASS="para">This chapter is about how to find things. We're excluding the<SPANCLASS="link"><EMCLASS="emphasis">find</EM> (<ACLASS="linkend"HREF="ch17_01.htm#UPT-ART-7410"TITLE="The find Command Is Great; The Problem Is Finding How to Use It">17.1</A>)</SPAN>utility itself because it's complicated and deserves achapter of its own. We'll concentrate on simpler ways to find files,beginning with some different ways to use <EMCLASS="emphasis">ls</EM>.</P><DIVCLASS="sect1info"><PCLASS="SECT1INFO">- <SPANCLASS="authorinitials">ML</SPAN></P></DIV></DIV></DIV><DIVCLASS="htmlnav"><P></P><HRALIGN="LEFT"WIDTH="515"TITLE="footer"><TABLEWIDTH="515"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch15_10.htm"TITLE="15.10 Wildcards that Match Only Directories "><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 15.10 Wildcards that Match Only Directories "BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><ACLASS="book"HREF="index.htm"TITLE="UNIX Power Tools"><IMGSRC="gifs/txthome.gif"SRC="gifs/txthome.gif"ALT="UNIX Power Tools"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch16_02.htm"TITLE="16.2 Finding Oldest or Newest Files with ls -t and ls -u "><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 16.2 Finding Oldest or Newest Files with ls -t and ls -u "BORDER="0"></A></TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172">15.10 Wildcards that Match Only Directories </TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><ACLASS="index"HREF="index/idx_0.htm"TITLE="Book Index"><IMGSRC="gifs/index.gif"SRC="gifs/index.gif"ALT="Book Index"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172">16.2 Finding Oldest or Newest Files with ls -t and ls -u </TD></TR></TABLE><HRALIGN="LEFT"WIDTH="515"TITLE="footer"><IMGSRC="gifs/smnavbar.gif"SRC="gifs/smnavbar.gif"USEMAP="#map"BORDER="0"ALT="The UNIX CD Bookshelf Navigation"><MAPNAME="map"><AREASHAPE="RECT"COORDS="0,0,73,21"HREF="../index.htm"ALT="The UNIX CD Bookshelf"><AREASHAPE="RECT"COORDS="74,0,163,21"HREF="index.htm"ALT="UNIX Power Tools"><AREASHAPE="RECT"COORDS="164,0,257,21"HREF="../unixnut/index.htm"ALT="UNIX in a Nutshell"><AREASHAPE="RECT"COORDS="258,0,321,21"HREF="../vi/index.htm"ALT="Learning the vi Editor"><AREASHAPE="RECT"COORDS="322,0,378,21"HREF="../sedawk/index.htm"ALT="sed & awk"><AREASHAPE="RECT"COORDS="379,0,438,21"HREF="../ksh/index.htm"ALT="Learning the Korn Shell"><AREASHAPE="RECT"COORDS="439,0,514,21"HREF="../lrnunix/index.htm"ALT="Learning the UNIX Operating System"></MAP></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -