Linux Classes
Linux Training
* Linux Classes *

LINUX CLASSES - FILES

How Does The Linux File System Work?

When Linux is installed, a file system is carved out a chunk of hard disk and formatted it so that Linux can use it. A hierarchical (treelike) structure for storing files imposes some order on the file system to help both you and the Linux find needed files.
In this section, you'll learn how to work with files and directories in a Linux system. You'll understand how the file system is structured to separate system data from personal data and how to navigate through it. We'll cover two ways to manipulate your files: using the command line and the Midnight Commander.

When you're done, you'll be creating, deleting, copying, renaming, listing, linking, and protecting your files like a pro. You'll also learn the Nine Deadly Keystrokes--or how to wipe out the entire file system without really trying. (But don't worry; this command can affect you only if you're logged in as root.)

Log in as hermie and try the examples in this section as you read through it. You'll find that the Linux file system is a lot like DOS, only more robust and flexible.

What Is a Linux File?

We've created a structured file system and filled it with a whole bunch of files--without knowing what Linux files are. Here's what files are in the Linux world and how they are named.

Types of Files

In most operating systems, a file is simply a blob of data stored on disk with a unique name. A file could be a list of names and numbers, a cheesecake recipe, or an executable program. But under Linux, everything is a file. In addition to data and executable files, Linux treats directories and even the various components of your computer as files.

This means there are files that represent your keyboard, console, printer, CD-ROM, and even your system's RAM. These special files are called devices, and they are found in the /dev directory (see Figure 4-1). (If you look in this directory later, you'll see files such as /dev/fd0 (a floppy drive), /dev/tty1 (a console), and others you may be able to identify by their names.) When Linux (or any Unix program) needs to talk to a physical hardware device, it does so by simply reading from or writing to one of these special files.

Previous Lesson: Help!
Next Lesson: Linux File Names

[ RETURN TO INDEX ]

Comments (most recent first)

ganesh khare     (09 Sep 2010, 06:19)
iam joining the class
Sunny /     (08 Sep 2010, 02:57)
hi
im new to red hat linux & i want to know detail file structure (e.g. what is /etc./dev )
saif     (15 Aug 2010, 09:40)
its a great resource i had been looking to play and learn linux, i have come to the right place...
ved n. vyas     (28 Jul 2010, 00:24)
It's a wonderful treasure of information
Russ     (27 Jul 2010, 15:01)
@Bob Rankin (regarding 28 Jan 2010, 09:20 comment):
You're a funny man. I like the site; thanks for your hard work.
Constantine     (20 Jul 2010, 07:09)
I did not know there was such a tutor as Bob until................. Bang!!!!!!!!!

So good a teacher
stephen     (10 May 2010, 10:50)
Outstanding work with this site. Kudos.
Otto     (27 Apr 2010, 11:41)
Sorry about the typo. Correct sentence is: "The guest doesnīt seem able to access the CD."
Otto     (27 Apr 2010, 11:39)
I installed Windows 98SE in an Ubuntu Hardy Heron host. Although I have good sound from the Ubuntu host when playing CD's, I havenīt been able to get the guest OS to play the CD's. The guest host doesnīt seem able to access the CD. Any suggestions?
Bob Rankin     (08 Apr 2010, 09:11)
You shouldn't need any sudo commands to run a Linux install. I've been installing various Linux distros for 15 years and have never needed to do that. I'm pretty sure all modern distros just boot from the install CD and run you through the install with a few clicks.
Collins     (08 Apr 2010, 06:58)
How can I master linux. Did in college, but I've forgotten it. Have it on a cd, but can't remember the sudo commands to run installations in the GUI phase.
Twodogs     (07 Apr 2010, 18:01)
Hey Bob, nice site. I'm reading through your tutorials (the one's 2 inches to my left lol). Good stuff! Thank you for your hard work.
Ernest     (31 Mar 2010, 19:13)
ubuntu linux, is a free open source operating system that has most of the same capabilities of microsoft, exept for many applications and games. linux depends on a debian program installer, in which it installs packages with the .deb extension
many can be found online, in ubuntu software center or installed via the terminal using this specified command "sudo apt-get install package name. system panels can be added or removed via the user, and objects can be added to the panel as well. within the same subject linux also offers great stability and protection... i hope this information helped
kuldeep     (26 Mar 2010, 22:03)
i am learning linux (ubuntu).plz tell me few tutorials for familiarize with linux.
thank you.
rimpy     (17 Mar 2010, 02:59)
what is going on??
Ernest     (15 Mar 2010, 14:29)
no, it is just that i can clearly state the fact that i can relate to this page in such that i work with linux computers, i build and rebuild pc's and have been doing it for quite some time.
Bob Rankin     (13 Mar 2010, 08:49)
I don't see how your comment is relevant to this page... Did you mean to post it somewhere else?
Ernest     (11 Mar 2010, 16:52)
this page seems quite ironic to me especially knowing ive used proshield and it detected a so called packet sniffer, i deleted it to find out it was two vital system files responsible for running and controlling my internet, so i had to load my linux 9.10 disk onto my system and patch it with the original files... lmao
Bob Rankin     (01 Mar 2010, 06:53)
It's been a long time since I've networked two linux computers. But if they are both connected to a router, they should both have IP addresses on the local network. In that case, you could connect to the other machine and transfer files using the ftp command. I'm sure there is also a way to mount the disk directly on a local network. Anyone want to chime in with a suggestion?
TorCanHazLinux?     (26 Feb 2010, 23:40)
Say I have two Linux computers connected with an ethernet cable. How can I transfer a file from one system to the other? Thanks for a fantastic site.
Robin     (19 Feb 2010, 19:37)
Bob, your site is a great resource for Linux newbies. Thanks for all your hard work.

P.S. Can you show me workings of linux? j/k ;)
Bob Rankin     (08 Feb 2010, 14:51)
@banwari - Are you kidding? Turn your head 2 inches to the left and you'll find the answer.
banwari     (08 Feb 2010, 01:11)
how to use linux commands & creat a file ?
Bob Rankin     (01 Feb 2010, 05:35)
See "Installing Packages With RPM" http://lowfatlinux.com/linux-rpm-install.html
yatindra     (30 Jan 2010, 09:10)
show me how to install software in linux
Bob Rankin     (28 Jan 2010, 09:20)
Ummm... yes?
masud     (27 Jan 2010, 00:36)
Can i know that details of linux works

*Name:
Email:
Notify me about new comments on this page
Hide my email
*Text:
 

Ask Bob Rankin - Free Tech Support
<Send This Link to a Friend>         <Bookmark This Page>


Copyright © by Bob Rankin
All rights reserved - Redistribution is allowed only with permission.