UPI Study › Courses › Introduction to Operating Systems › Free lessons › Lesson 6.3 Free with a free account
File Managers
Introduction to Operating Systems · Chapter 6: File Systems and Data ManagementSection 6.3 · lesson 50 of 837 min · free with a free account
Free preview
Create a free account to keep watching
It takes a minute and costs nothing. Your free account unlocks all of Chapter 1 and 3 more lessons of Introduction to Operating Systems.
Lesson complete
Earn the 3 college credits for Introduction to Operating Systems
Enrolling adds a quiz after each lesson, the graded work and the official transcript. Recommended for credit by NCCRS.
Next lesson: File Allocation Methods →← The Anatomy of a File SystemNext lesson: File Allocation Methods →
A free account plays all of Chapter 1 and 3 more lessons of Introduction to Operating Systems. Create a free account →
In this lesson
How graphical and command-line file managers do the same jobs.
- List the core jobs every file manager performs through the operating system
- Use mkdir, cp, mv, rm and find to create, copy, move, delete and search files
- Read the columns of an ls -l listing
- Explain how hidden dot files and the Trash differ from real protection and real deletion
Free study notes
Get this lesson's notes by email
The key points and 4 practice questions with answers, in your inbox. One email, free.
One email. Unsubscribe in one click.
Transcript
Everything said in the video, section by section (1,028 words). Read along, or search it.
Opening Question
Window or Typed Command
Ask a librarian for a book, and she doesn't hand you the whole shelf. She finds it, lends it, puts it back, and keeps the records straight. A file manager does that job for your files. Whether you click on pictures or type commands, you're talking to the same helper, working on the same tree. So which is better, the window or the typed command? By the end of this lesson, you'll see why that's the wrong question.
Core Jobs
Browse, Create, Copy, Move, Delete, Search
Every file manager does the same few jobs. Browse: see what's in a folder. Create: make a new folder or file. Copy: make a second file with the same contents. Move or rename: change where a file is listed, or what it's called. Delete: remove a name, and so, in the end, the file. And search and sort: find a file by its name, type, size or date. A file manager never touches the drive's sectors itself. It asks the operating system through system calls, and the file system does the real work. So every file manager obeys the same rules.
Two Views
Graphical Windows and the Shell
A graphical file manager draws folders as icons that you double-click. The shell shows the same folders as lines of text. The window is easy to learn, and good for browsing pictures. Typed commands are fast to repeat, can be saved in a script, and one line can copy a thousand files. Neither one is the real one. The real thing is the tree on the drive, and many people use both.
Creating Files
Making Folders With mkdir
Let's do the core jobs by typing. Sam, who runs a small online bakery, wants to tidy a desk folder. Make it with mkdir desk, and step into it with cd. Echo puts today's order into a file, order dot t x t. Then mkdir dash p makes a folder called archive, with a folder twenty twenty-six inside it, in one go.
Copy and Move
Copying With cp and Moving With mv
Now copy. cp order dot t x t, order underscore backup dot t x t, makes a second file with the same contents. And move. mv order dot t x t into archive slash twenty twenty-six, with the new name monday dot t x t. find dot, piped into sort, lists every path under this folder. It's a plain-text picture of the tree. Two files hold the order now: the backup, and monday dot t x t in the archive. The name order dot t x t is gone.
Key Idea
Moving and Renaming Are One Action
Notice that mv moved and renamed in one step. That's because both are the same action: changing a name in a directory, as in lesson six point two. Rename the backup to order underscore old, delete it with rm, and list the tree again. The backup is gone. Searching is a job too. find dot, dash name, star dot t x t, finds every name ending in dot t x t, however deep it sits.
Quick Check
What rm Does to a Folder
Quick check. The archive folder still holds monday dot t x t. Now Sam types rm archive, with no options. Does it refuse, delete the folder and everything inside, or send it to the Trash? Pause and predict. It refuses. On this Mac, rm says archive is a directory, and nothing is deleted. Linux words it a little differently, but it refuses too. To remove a folder with everything below it, you ask on purpose, with dash r, for recursive. And the tree is empty again. The Trash is the tempting answer, but only graphical file managers have one. Deleting there is really a move into a special folder, so you can move the file back. The typed rm has no such folder. The name is gone at once, so check it twice before you press Enter.
Real Example
Finding a Lost Folder With Search
Search pays off. Sam once dragged a folder of order sheets onto the wrong folder, and couldn't find it anywhere. Ivy, who looks after the computers at a school, typed orders into File Explorer's search box. The folder showed up in a second, tucked inside the folder Sam had dropped it onto. Search beats scrolling, she said, and showed Sam how to drag it back.
File Details
Properties, Get Info and ls -l
Right-click a file and choose Properties, or Get Info on a Mac, and you see its card from lesson six point two. In the shell, ls dash l shows the same facts. Make a file and a folder again, and list them with ls dash l n. The n asks for the owner and the group as ID numbers, instead of names. There's one line per file. Let's read one, column by column.
Reading the Output
Column by Column in a Long Listing
The first letter is the type: d for a directory, and a dash for a plain file. Then come nine permission letters, for lesson six point seven, and the link count. Next come the owner, the account that made the file, and the group it belongs to. With dash n, both are the ID numbers the system really stores. Plain ls dash l looks up their names. Then the size in bytes, the time of the last change, and the name. On your machine, these numbers and the dates will differ. And the at sign after the permissions is a Mac mark: the file carries extra labels, called extended attributes.
Hidden Files
Dot Files Are Hidden, Not Locked
On a Mac or on Linux, a name that begins with a dot is hidden. Make a settings file called dot settings, and plain ls skips it. ls dash a shows everything, dot settings included. Finder hides these files too, by default. Hiding is a habit, not a lock. Anyone can show hidden files, so a dot never protects a secret. Permissions do that, in lesson six point seven. And when you double-click a file, the file manager picks the program to open it, usually by the file's extension. That's lesson six point five.
Key Takeaways
Two Ways to Ask for the Same Work
To recap. Every file manager browses, creates, copies, moves, deletes and searches, by asking the same operating system. cp leaves the original, while mv changes a name or a place. Moving and renaming are one action. rm refuses a folder unless you add dash r, and it has no Trash. So the window and the typed command aren't rivals. They're two ways of asking for the same work on the same tree.
About Introduction to Operating Systems at UPI Study
Introduction to Operating Systems (Computer Science 354) is a self-paced online course of 83 video lessons in 10 chapters, from what an operating system does and process scheduling to concurrency, memory, devices, file systems, networks, the internet, security and virtual machines. It carries a NCCRS credit recommendation for 3 semester credits.
Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Enroll now → Course details Download the syllabus All Computer Science courses Every course with PRO →
Compare: Linux vs Operating Systems
Why take it here
Why students take Introduction to Operating Systems with UPI Study
Where the credit goes
Universities that work with NCCRS
Introduction to Operating Systems carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
Thomas Edison State UniversitySigned partner
University of the PeopleSigned partner
Charter Oak State CollegeSigned partner
Strayer UniversitySigned partner
Columbia Southern UniversitySigned partner
Indiana TechSigned partner
Penn StateWorks with NCCRS
Southern New Hampshire UniversityWorks with NCCRS
SUNYWorks with NCCRS
+many more cooperating universitiesFind my college →Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.
FAQ
Questions students ask us
About File Managers
What is the difference between cp and mv?
How do you delete a folder and everything inside it with rm?
What do the columns in ls -l output mean?
How do you show hidden files on Mac or Linux?
About the Introduction to Operating Systems course
How many college credits is Introduction to Operating Systems?
How much does Introduction to Operating Systems cost and what is included?
Which universities accept UPI Study credits?
How long does Introduction to Operating Systems take?
How are the exams done?
How do my credits reach my college?
Ready for the full course? Earn 3 credits in Introduction to Operating Systems.
83 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.
Updated
3 credits · NCCRSEnroll →