Jump to content
zbeng

The linux file system

Recommended Posts

<p class=MsoNormal>The Linux File system isn’t to hard to learn,

it isn’t as

simple as Windows, but if you plan on running Linux you should know

where your

files are. This paper is for users new to Linux, experienced people

most likely

wont learn too much from this paper. </p>

<p class=MsoNormal>The Root Directory</p>

<p class=MsoNormal>The file system can be thought of as a sort

of tree, the

trunk or start of this tree is the root directory which is

represented by a

forward slash ‘/’. All the other directories branch off from this

one.</p>

<p class=MsoNormal><o:p></o:p></p>

<p class=MsoNormal>Common Subdirectories of the Root</p>

<p class=MsoNormal>/bin – Common programs, often binary

files</p>

<p class=MsoNormal>/boot – Files for booting the system, this

is where the

kernel is</p>

<p class=MsoNormal>/sbin – Programs designed to be run by the

superuser or root</p>

<p class=MsoNormal>/lib – Libraries of code</p>

<p class=MsoNormal>/dev – Device files for interfacing with

hardware</p>

<p class=MsoNormal>/mnt - Mount point, directors that provide

access to the

disks</p>

<p class=MsoNormal>/etc – System config files, similar to

windows control panel

</p>

<p class=MsoNormal>/lost+found – Files that were saved during

failures are here</p>

<p class=MsoNormal>/misc – Miscellaneous purposes</p>

<p class=MsoNormal>/tmp – Temporary space for use by people or

the system</p>

<p class=MsoNormal>/var – Storage for variables and temporary

files such as the

mail queue </p>

<p class=MsoNormal>/usr – more system files supplied with

Linux</p>

<p class=MsoNormal>/proc – Currently-running

processes</p>

<p class=MsoNormal><o:p></o:p></p>

<h2>Important Files and

Directories <o:p></o:p></h2>

<p class=MsoNormal><o:p></o:p></p>

<p class=MsoNormal>The Kernel</p>

<p class=MsoNormal>The kernel is the heart of the system, it

controls the

communication between the hardware and the peripherals. The kernel

makes sure

that processes and daemons (server processes) are started and

stopped at the

exact moments. The kernel has many important tasks, it would lead us

too far

away to discuss the kernel in detail. For now it is just important

that you

know the kernel is the most important file on the system. </p>

<p class=MsoNormal><o:p></o:p></p>

<p class=MsoNormal>The Shell</p>

<p class=MsoNormal>The shell is a way to interface with the

computer for typing

commands, executing them, and displaying the results, and it is a

way of

navigating the directory tree. Similar to the Dos command prompt.

The shell is

an advanced way of communicating with the system.</p>

<p class=MsoNormal>Shell Types</p>

<p class=MsoNormal>yes"> style='mso-tab-count:1'> sh

or Bourne Shell: this is

the original shell still used on Unix systems. This is the basic

shell, it’s a

small program with a few features.</p>

<h1>bash or Bourne

again shell: this is the

standard shell. The Bourne shell is compatible with the Bourne Again

Shell,

commands that work in sh style='font-weight:normal'>will also work

in bash. However it doesn’t always work the other way

around.<o:p></o:p></h1>

<p class=MsoNormal>

csh or

C cshell: Resembles the syntax of the C programming

language.</p>

<p class=MsoNormal>

tcsh or

Turbo C shell: an enhanced version of the common C shell.</p>

<p class=MsoNormal>If you don’t know which shell you are

using, type the

command ‘echo $SHELLstyle="mso-spacerun: yes">

<o:p></o:p></p>

<p

class=MsoNormal><o:p></o:p></p>

;

<p class=MsoNormal>Navigating the Directory Tree</p>

<p class=MsoNormal>yes"> </p>

<p class=MsoNormal>The ‘cd

Command</p>

<p class=MsoNormal>The cd (change directory)

command will change your

current directory. Using the cd command with no

arguments will set your

shell’s current working directory to your home directory. Example

cd mnt

will take you to the /mnt directory</p>

<p class=MsoNormal><o:p></o:p></p>

<p class=MsoNormal>The ‘ls

Command</p>

<p class=MsoNormal>The ls command lists

files and folders in your

current working directory. To list all files in your current working

directory

you would just type ‘ls’ by default ‘ls’

will hide files that

begin with a period. Other useful arguments are:</p>

<p class=MsoNormal>-a lists all files

including those that start with a

period</p>

<p class=MsoNormal>yes"> -l long

listing, will give more details about each file.</p>

<p class=MsoNormal>[if !supportEmptyParas]

[endif]<o:p></o:p></p>

<p class=MsoNormal>The ‘cp’

Command</p>

<p class=MsoNormal>This is the copy command. To use it you

would type ‘cp

file1 file2’ where file1 is the file you wish to copy and

file2 is the name

you want to copy it too. You can use path names for example

cp

/home/alxciada/linux1.txt /home/flatline/linux1.txt’

style="mso-spacerun: yes"> which would

copy a file called linux1.txt

from my home directory to flatline’s home directory. Other useful

arguments

are:</p>

<p class=MsoNormal>-p – Will copy not only

the file contents, but also

the file’s permissions, timestamps and owner. (By default the owner

of the copy

will be you, it will be time stamped now)</p>

<p class=MsoNormal>-i – interactive mode.

Ask before overwriting files</p>

<p class=MsoNormal>-f – Force the

copy.</p>

<p class=MsoNormal>[if !supportEmptyParas]

[endif]<o:p></o:p></p>

<p class=MsoNormal>The ‘rm’

command</p>

<p class=MsoNormal>The ‘rm’ (remove

command) can delete files and

directories, simply type ‘rm filename’. style="mso-spacerun:

yes"> Some useful arguments are:</p>

<p class=MsoNormal>-i – interactive mode,

ask before deleting each file</p>

<p class=MsoNormal>-f – forces the

deletion, ignore errors and warnings </p>

</div>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...