Skip to Main Content
Take Control of the Mac Command Line with Terminal, 2nd Edition
book

Take Control of the Mac Command Line with Terminal, 2nd Edition

by Joe Kissell
February 2016
Beginner content levelBeginner
167 pages
3h 29m
English
Take Control Books
Content preview from Take Control of the Mac Command Line with Terminal, 2nd Edition

Work with Files and Directories

Much of what you’ll need to do on the command line involves working with files in some way—creating, deleting, copying, renaming, and moving them. This chapter covers the essentials of interacting with files and directories.

Create a File

I want to mention a curious command called touch that serves two interesting functions:

  • When applied to a nonexistent file, touch creates an empty file.
  • When applied to an existing file or folder, touch updates its modification date to the current date and time, marking it as modified.

Try entering the following command:

touch file1

Now use ls -l to list the contents of your current directory. You’ll see file1 in the list. This file that you’ve just created is completely ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Take Control of Automating Your Mac, 5th Edition

Take Control of Automating Your Mac, 5th Edition

Joe Kissell

Publisher Resources

ISBN: 9781457191107