intro-to-linux
intro-to-linux
Environment
Brian E. Brzezicki
First things first
• Log in to your linux machine using
– Username: student
– Password: student01
Terminal!
Next Linux is VERY text based environment, so
let’s get used to the Terminal!
Click on Applications->Accessories->Terminal
until you get this! (next slide)
Terminal
Terminal
• Go ahead and close it (click on the “x” in the
windows top bar) and open it again… you
need to get comfortable with the terminal
window!
Basics of the Linux File
System structure
File System Layout
Linux is layed out in a heirarchical manner
starting from the “root” ( / ) directory. This is
similar to MS Windows except that
• Linix uses the / as a directory seperator,
Windows uses a \
• Windows has multiple “roots” one for each
drive (C:, D: etc). Linux has a single root,
separate physical drives are “grafted” onto the
tree
(see image)
Linux File System
Entering Commands
When Entering commands in Linux, most
commands take a filename as an option. You
can specify a filename as a
• Full path – Example:
cat /etc/passwd
cd /usr/local
ls
What is the response?
File System Commands
How about
ls –l
Example
grep root /etc/passwd > /tmp/grep_results.txt
or
grep root < /etc/passwd
Process operators
Often in Linux you will want to see what
processes are running and possibly
manipulate them you do this will the
commands
ps
ps –ef
kill
kill -9 pid
kill –TERM pid
su
In unix you generally log in as a “user” account
rather than the superuser account
su – root
su - student
vi
Linux adminstration is very much about text
configuration files. When you have a GUI you
can edit these files with a normal editor…
however if you want to run Linux you better
get used to a text editor. I’d suggest vi
Movement mode
Edit mode
:XX
Where XX is a line number
Example
Typing
:50 would take me to line 50
vi edit mode
Once we are were we want to type or delete
in the file we can use “edit mode”
commands.