Main index

Introducing UNIX and Linux


Files

Overview
The UNIX directory hierarchy
Filesystems
Manipulating files
      Creating directories
      Creating files
      links
      'Dot' files
Protecting files
      Groups
      File access control
      Changing privileges
File contents
      Text files
      Comparing files
      Filtering files
      Non-text files
Printing files
File archives and file compression
Other relevant commands
Summary
Exercises

Answer to chapter 5 question 5

Running ls with options -l and -d followed by a dot (the current directory) will display details about the current directory. The owner of the file begins in character column 16 and may continue until column 23, so use cut with option -c to select columns 16 to 23:

ls -ld . | cut -c 16-23

Copyright © 2002 Mike Joy, Stephen Jarvis and Michael Luck