View a List of Files in Subfolders


ls -R

You can also view the contents of several subdirectories with one command. Say you're at a Linux Users Group (LUG) meeting and installations are occurring around you fast and furious. "Hey," someone hollers out, "does anyone have an ISO image of the new Kubuntu that I can use?" You think you downloaded that a few days ago, so to be sure, you run the following command (instead of ls -R, you can have also used ls --recursive):

$ ls -R ~/iso iso: debian-31r0a-i386-netinst.iso knoppix ubuntu iso/knoppix: KNOPPIX_V4.0.2CD.iso  KNOPPIX_V4.0.2DVD.iso iso/ubuntu: kubuntu-5.10-install.iso   ubuntu-5.10-install.iso kubuntu-5.10-live.iso      ubuntu-5.10-live.iso 


There it is, in ~/iso/ubuntu: kubuntu-5.10-install-i386.iso. The -R option traverses the iso directory recursively, showing you the contents of the main iso directory and every subdirectory as well. Each folder is introduced with its pathrelative to the directory in which you startedfollowed by a colon, and then the items in that folder are listed. Keep in mind that the recursive option becomes less useful when you have many items in many subdirectories, as the listing goes on for screen after screen, making it hard to find the particular item for which you're looking. Of course, if all you want to do is verify that there are many files and folders in a directory, it's useful just to see everything stream by, but that won't happen very often.



Linux Phrasebook
Linux Phrasebook
ISBN: 0672328380
EAN: 2147483647
Year: 2007
Pages: 288

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net