LINUX CLASSES - FILES

The Linux File System

How Does The Linux File System Work?

When Linux is installed, a file system is carved out of a chunk of hard disk and formatted 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 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 Linux Directories). (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
(Please feel free to answer questions posted by others!)

Russ     (22 Oct 2013, 06:59)
Hi Dr Bob, I would like to put Linux on an old Pentium PC and have it sit on my local network, and be able to talk to it through my XP machine (like through a terminal) and through my browser (like Firefox) and eventually have it control things, but I don't know where to start. Any suggestions? I know a little C, php, html, css, JavaScript and a variety of assembly languages.
base64decode.net     (11 Jul 2013, 15:10)
great explanation Bob, thank you
tsureshb     (09 Feb 2013, 20:37)
i want to be master in linux
John Mark O. Aspilla     (04 Dec 2012, 02:06)
Linux file system are a system that files Linux

dinesh     (19 Nov 2012, 07:09)
what are "." and ".." files in linux directory? Its created in all directories
raza ali     (08 Oct 2012, 09:39)
Dear BoB i want to Create a Linux shell (in other words, write a C program) that will recursively prompt for input from the user. The shell should prompt as
Number-currentDirectoryName>
tell me hoe to do it...
ROHIT KUMAR     (21 Sep 2012, 08:12)
Really nice...
Schartz Rehan     (22 Apr 2012, 14:32)
Hi Bob,
Lot of appreciations for this excellent compilation of the material in the form of such an accessible website.
Great job. I learned a lot of things from here.
Surely, I'll tell my friends about it (they are pretty linux enthusiasts).

Thanks for taking so much pain for helping the learner community.
anthony abz     (11 Apr 2012, 01:49)
hi bob
ahm i just want to know more about linux file system can you help me about it
good day and gobless tnx!!
Isaac kamoju     (03 Apr 2012, 14:11)
Good day sir, i will like to know or get the procedure on how to make a presentation on linux file system. tank you sir and God bless you sir.
srinivas     (03 Apr 2012, 06:32)
Hi sir,a good tutorail,can u send the tutorial to my mail
Harshit     (21 Mar 2012, 04:33)
@ Amit kumar,
author may do not understand hindi language so post in english only.
you can use windows and linux simultaneously with VMware software.
From VMware you can create virtual linux in windows environment.
Narayan     (19 Mar 2012, 08:40)
Dear sir,

can i have PDF file.

Regard's
Narayan
amit kumar     (18 Mar 2012, 00:00)
hiiii
sir
i m engg student.
kya aap mujhe bata sakte hai ki me win7 use kr raha hu aur me linux bhi use krna chata hu . to kya me linux install kr sakta hu. pls tell me
Bill Frilman     (17 Mar 2012, 16:00)
Hi Bob,

GREAT site. You've reallly done a good job of laying out Linux.

Here's a question. I'm working with DOS/NTFS drives in linus. I can mount them and examine the contents but can't find how to display the volume label.

I've spent several hours without luck. Can you help?

Bill
neela     (10 Mar 2012, 09:25)
hi bobs,i am neela from Bangladesh.i want to larn linux but i dont understand the installing systen,and the command.do you help me?
siva     (28 Feb 2012, 06:19)
hi bob,excellent tutorial,it helped me a lot,i am from india,i have seen lot of silly comments posted over here by my fellow indians,a word of advice for them,please go through the site completely before pressing "please help me" button,i agree that those comments irritates everyone but please don't form a negative opinion against entire indian community.i have also seen some sarcastic comments ridiculing outsourcing,no body outsources their work just because it is cheap,anyways,this is not the site for the debate on outsourcing,great work bob,thanks a ton for this brilliant site.
Bob Rankin     (10 Feb 2012, 14:16)
@Bryan - I fixed the link to the figure. You can step through the course with the "Previous / Next" links at the end of each article.
Bryan     (10 Feb 2012, 14:09)
I am lost on this page, It sounds like there is supposed to be long page. Example, towards the end of the last paragraph it says (see Figure 4-1). where is this diagram?? It also said log in as hermie ...where is that at? This page looks like a partial page to a course that is a lot larger then I can see ... Am I missing the larger area?

Very interested in the course though
Dhiren kumar sahoo     (02 Feb 2012, 07:01)
i am new in linux and want to build career in linux.
so how can increase my knowledge in linux plz help me
VB     (31 Jan 2012, 18:50)
Thanks for tutorials - they are really helpful.. However, friend of mine suggested to use 'mc' command - and now I'm happy to navigate file system using UI I know (NC and FAR under Windows). I guess you should mention mc here for newbies like me.
Regards!
ultramanjones     (23 Jan 2012, 20:10)
LOL Bob it looks like everyone thinks you are Santa Claus! They keep asking you for anything they can think of. Keep growing that beard I guess. Thanks for the tuts. Cheers!
James     (18 Jan 2012, 20:16)
Are there really this many Indian Trolls on your site bob? Two out of every three comments are absolutely in left field.

P.S. Thanks for the site. Check out Nerdtattoos.com for a giggle in return
pksaini     (18 Jan 2012, 12:00)
sir ,i need F90 compiler for linux redhat-5.where can i get it.thanks
md aftab alam     (18 Jan 2012, 07:54)
sir i hv 2 get full knowledge of linux os so plz tell me how can i prepare of linux.............thanks
Ike     (16 Jan 2012, 20:07)
How can i open an application using linux ubuntu Terminal?
Need accurate Reply S>O>S> ???
saad     (06 Jan 2012, 16:42)
thanks a lot Bob
I am new to linux and I love what I read here

by the way the rest of this message is to the indian community here who want to learn to use linux but they still dont know how to install it
learning linux is an adventure where you have got to explore on your own and if you want everything spoonfed better give up (I am saving a lot of your time)
Kelly Grant     (04 Jan 2012, 14:57)
The ,v means the file is under configuration management. The ,v file is the archive, and when checked out, the working filename will be all letters up to but not including the ,v part.
Aaron     (03 Jan 2012, 22:02)
Hi Bob,
...what color of sweater vest goes best with red Chuck Taylors? Should I ask for a promotion? ...sorry, I was caught up in the "outsourced" conversation!
Seriously though- fantastic class. This exactly what I was looking for, and right at the level I wanted to start. I multiboot 6 Linux distros and Windows 7, and I have yet to learn the things I am here. Keep up the good work.
One more thing- we are responsible for ourselves in life. This guy has taken his own time to help a bunch of ungrateful people luke us out, and to quote an earlier post, he is doing it FOR FREE. If you want career advise, I am sure there are a thousand blogs out there that would accommodate. Hop back on your substandard Windows box, and go there.
hadi     (15 Dec 2011, 03:22)
Hey Bob
i am bigginer of Linux. i dont know about this os. could you introduce me useful information to starting it. also i have question about one problem that i could not connect to Linux from windows 7. please tell me about this. Thank you
Best, Hadi
nick     (28 Nov 2011, 15:46)
"Bob, can you point me to a tutorial on Linux?". Hilarious...I'm guessing a career in computers didn't work out for this person : )

Anyway, these tutorials are great. Thanks for providing these for us!
aaron     (27 Nov 2011, 13:45)
Hey Bob,
Can you come to my house and hold my hand while i try to install linux? Then I need you to teach me all the commands and after that you can wash my car.
Thanks!
Luis Rangel     (23 Nov 2011, 08:56)
Slide share and 4shared have the lpic2
javad     (19 Nov 2011, 16:01)
i want ebook lpic2
Bob Rankin     (09 Nov 2011, 15:40)
@Habib - You think it's "your right" that my brain should be ported into yours? I hope you have good medical insurance, because that's gonna hurt. :-)
Habib     (09 Nov 2011, 10:23)
Bob,
I wish to learn linux in the fullest of ways. Port your brain into mine so that I can also know the ways of Linux. Give me all of the answers becuause it is my right.
Larry     (01 Nov 2011, 12:26)
I'm exhausted searching for an answer to my question. I'm trying to find out what the significance is of the ",v" in a filename eg.

mysourcefile.c,v

Tim C     (16 Oct 2011, 11:49)
@sivakumar... hi

I took care of that one for you Bob... no thx necessary... I've got your back brother.

Anyway, thanks for all the hard work, time, and dedication you've put into this site. It is excellently done, concise, professional, informative, and is a great service to the LINUX community.

warm regards,
Tim
sivakumar     (10 Oct 2011, 06:54)
hi
bill bertrand     (05 Oct 2011, 12:13)
bob, I found your sight, the person that install linux, ubuntu, retired and move away,i don't know if their is a linux person in my area my zip is 17020. i want to learn this sys. but it's in some kind of foreign format i hope this can be in very simple english w/out getting in trouble with microsoft language. also we have a dell laptop which needs converted to linux,
thank you,
Bob Rankin     (04 Oct 2011, 08:12)
@Fida, Since you were looking at a Linux tutorial when you wrote your strange comment, I'm not sure what to suggest.
Fida     (03 Oct 2011, 14:28)
I want to learn Linux more practically ,how do I do it? please GUIDE me and plz tell me few tutorials.......thanku ,awaiting response

Sasi     (29 Sep 2011, 07:30)
How linux is different and advantageous as compared to microsoft word
Apolin Borges, St. Paul's, Belgaum     (28 Sep 2011, 03:36)
Hey Bob, I am teaching in school as a computer master. Our principal has decide to install linux in computer lab. I installed Ubuntu 10.04. It's working nicely. In Primary, we are teaching Kturtle, Openoffice and some educational games. Everything is going nicely. but now we are facing problem of text book. Because these text books are not avilable in market. Big book are useless for primary student. Can u tell me where i will get text books or notes. thank you bye..
Jonel     (30 Jun 2011, 04:08)
what do you mean by running cmd1 and append its output to file1?

it is said that cmd1 is an arbitrary command in linux. i am new to linux and i want to know more about it. thank you :)
Bob Rankin     (15 Jun 2011, 00:00)
@Aravind - Just keep reading!
Aravind     (14 Jun 2011, 23:59)
Hey bob canu get the basics details of linux.Please u can send to my ID.Am happy with ur material.


Regards
Aravind T
Vishal P     (06 Jun 2011, 01:56)
Can u tell me difference between RHEL5 & RHEL6 ?
Mbango     (05 Apr 2011, 06:20)
This is good, i learn how to make carrot juice from linux !! and iz good tutorial..nice teacher
Kireeti     (03 Mar 2011, 06:20)
hey bob can u please suggest me a good version of linux where there is chance to see everything that happens there instead of those with graphics and covering all the real stuff.....
jonalyn     (28 Feb 2011, 01:50)
thanks a lot!!!!!!!!!!1
this page help me to my problem !!!!!!!!!1
god bless!!!!!!
"AGAIN" thank you!!!!!!!!!!!!
sdfx     (10 Feb 2011, 14:50)
Appreciate the site.
If only you could clear the senseless comments..
ravinder kumar     (24 Jan 2011, 12:26)
i want to start from basics.....from where to get that
kemo fofana     (19 Jan 2011, 06:59)
I am a stater in linux and i want to developed my self in it
Tanoy     (16 Jan 2011, 00:56)
I want to know UNIX file system.Pls help me
janet onoja     (11 Jan 2011, 08:49)
Can I download the Linux classes to a pdf file in order to use off line. Thanks
Nimesh     (28 Dec 2010, 14:44)
I wan to know that how to install a linux in my pc can you help me for that
Bob Perkel     (25 Dec 2010, 19:04)
Can I download the Linux classes to a pdf file in order to use off line. Thanks
sabjit     (20 Dec 2010, 16:50)
How do I learn LINUX practically,is there any good websites which I should go online and start practicing .

Thanks
Bob Rankin     (13 Dec 2010, 18:47)
@Pete - Thanks, fixed now!
Pete     (13 Dec 2010, 17:53)
Great site! Minor 'editorial' comment: The opening 2 sentences are missing a word or 2. Cheers :)
udaya     (08 Dec 2010, 02:31)
good site....
satyejitt     (04 Dec 2010, 19:37)
I want to learn Linux more practically ,how do I do it? please GUIDE.......thanku ,awaiting response
France     (18 Nov 2010, 19:41)
Thank you, I learned a lot from this site...
anil     (11 Nov 2010, 02:39)
very good notes and help to me .to learn.am virgin in linux.so any one say to me ,opportunities for netwoking linux how to go throw it tell me .
Bob Rankin     (10 Nov 2010, 21:45)
@Aakash and @Sitara -- you guys are both taking the same class or something?
sitara     (10 Nov 2010, 02:34)
provide me whole working structure of linux file system.
Aakash     (12 Oct 2010, 04:39)
give the example of the Linux file system working and about its file management and it file structure
totally about its file system.....
bayaraa     (09 Oct 2010, 08:23)
How do create and delete ext2 file system?can you help me?
thobo thobo     (15 Sep 2010, 04:36)
/etc directoty stores the system related data that users and the system need to refer to,such as password file.and /dev directory stores all the device-related files for the system.
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

I welcome your comments. However... I am puzzled by many people who say "Please send me the Linux tutorial." This website *is* your Linux Tutorial! Read everything here, learn all you can, ask questions if you like. But don't ask me to send what you already have. :-)

NO SPAM! If you post garbage, it will be deleted, and you will be banned.
*Name:
Email:
Notify me about new comments on this page
Hide my email
*Text:
 
 


Ask Bob Rankin - Free Tech Support


Copyright © by - Privacy Policy
All rights reserved - Redistribution is allowed only with permission.

Popular Pages