Security Strategies in Linux Platforms and Applications Lesson 6
Linux Lesson 2 A
-
Upload
maria-anderson -
Category
Documents
-
view
216 -
download
0
Transcript of Linux Lesson 2 A
-
8/10/2019 Linux Lesson 2 A
1/7
Linux Lesson 2From digitalb0y
Filesystem Layout:
/home personal User data similar to /Users on windows/etc all your configuration files/var system logging /mail /print spooling/bin core user binary programs !used to booting system"/sbin core #uper User binary programs !used to booting system"/usr/bin User binary programs/usr/sbin $ #uper User binary programs/opt/ $ %hird party software#pecial directories/dev $&evice files of system hardware/proc #pecial files on containing information about system resources
'avigation the shell prompt
pwd - Shows the present working directory
[ digitalb0y@linuxbox ~]$ pwd
/home/digitialb0y
cd change directory
[ digitalb0y@linuxbox ~]$ cd /usr/X11R6/bin 6/bin
[ digitalb0y@linuxbox bin]$ pwd/usr/X11R6/bin
[ digitalb0y@linuxbox bin]$ ls
nimate import x!wpnother"e#el lbxproxy xg
udio listres xgaluto lndir xgammon%anner ma&edepend xg'(as'ade ma&eg xget!ile(lean mergelib xgopher)orm m&dirhier xhexagons*dent m&!ontdir xhost+ager m&xauth xieper!+ager,noxpm mogri!y xinit
mailto:digitalb0y@linuxboxmailto:digitalb0y@linuxboxmailto:digitalb0y@linuxboxmailto:digitalb0y@linuxboxmailto:digitalb0y@linuxboxmailto:digitalb0y@linuxboxmailto:digitalb0y@linuxboxmailto:digitalb0y@linuxbox -
8/10/2019 Linux Lesson 2 A
2/7
Run-. montage xiterm Run-. !ter tep mt# x ewelRun-. )#wm23 mt#p x&bbellRun-. .-. nxterm x&b'omp
Important facts about file names
( File names that begin with a period character are hidden. his only means that ls will not list them unlessyou say ls -a . !hen your account was created" se#eral hidden $iles were placed in your home directory
to con$igure things $or your account. %ater on we will take a closer look at some o$ these $iles to see how
you can customi&e your en#ironment. 'n addition" some applications will place their con$iguration and
settings $iles in your home directory as hidden $iles.
(. File names in %inu)" like *ni)" are case sensiti#e. he $ile names +File1+ and +$ile1+ re$er to di$$erent $iles.
,. %inu) has no concept o$ a +$ile e)tension+ like legacy operating systems. -ou may name $iles any way you
like. he contents/purpose o$ a $ile is determined by other means.
) !hile %inu) supports long $ile names which may contain embedded spaces and punctuation characters"limit the punctuation characters to period" dash" and underscore. Most importantly, do not embed
spaces in file names. '$ you want to represent spaces between words in a $ile name" use underscore
characters. -ou will thank yoursel$ later.
Looking Around
ow that you know how to mo#e $rom working directory to working directory" we re going to take a tour o$ your%inu) system and" along the way" learn some things about what makes it tick. 0ut be$ore we begin" ' ha#e to teachyou some tools that will come in handy during our ad#enture. hese are
ls 2list $iles and directories3 more and less 2#iew te)t $iles3
ls
he ls command is used to list the contents o$ a directory. 't is probably the most commonly used %inu)command. 't can be used in a number o$ di$$erent ways. 4ere are some the switches
$l #hows the long format list$* *ecursively list subdirectories encountered
$r *everse the order of the sort to get reverse lexicographical order
or the oldest entries first !or largest files last+ if combined with
sort by si,e
$# #ort files by si,e
http://linuxcommand.org/man_pages/ls1.htmlhttp://linuxcommand.org/man_pages/less1.htmlhttp://linuxcommand.org/man_pages/less1.htmlhttp://linuxcommand.org/man_pages/ls1.html -
8/10/2019 Linux Lesson 2 A
3/7
-
8/10/2019 Linux Lesson 2 A
4/7
4rw4444444 1 bshotts bshotts 356 pr 15 122 weather txt
drwxr4xr4x 6 bshotts bshotts 1078 9't 2 1222 web,page
4rw4rw4r44 1 bshotts bshotts 7568 0 )eb 11 70:81 web,site tar
4rw4444444 1 bshotts bshotts 358 ;e' 16 122 xmas,!ile txt
4444444444 4444444 4444444 44444444 444444444444 4444444444444 < < < < < < < < < < < )ile =ame < < < < < < < < < >444 .odi!i'ation ?ime < < < < < < < >4444444444444 i e Ain bytesB < < < < < >44444444444444444444444 Croup
< < < >44444444444444444444444444444444 9wner < >4444444444444444444444444444444444444444444444 )ile +ermissions
File amehe name o$ the $ile or directory.
Modification !imehe last time the $ile was modi$ied. '$ the last modi$ication occurred more than si) months in the past" thedate and year are displayed. 5therwise" the time o$ day is shown.
"i#ehe si&e o$ the $ile in bytes.
$rouphe name o$ the group that has $ile permissions in addition to the $ile s owner.
%wner he name o$ the user who owns the $ile.
File &ermissions representation o$ the $ile s access permissions. he $irst character is the type o$ $ile. +7+ indicates aregular 2ordinary3 $ile. +d+ indicates a directory. he second set o$ three characters represent the read"write" and e)ecution rights o$ the $ile s owner. he ne)t three represent the rights o$ the $ile s group" and the
$inal three represent the rights granted to e#erybody else.
more
More is a program that lets you #iew te)t $iles his is #ery handy since many o$ the $iles used to control andcon$igure %inu) are human readable.
more filename
-
8/10/2019 Linux Lesson 2 A
5/7
-
8/10/2019 Linux Lesson 2 A
6/7
ow we will runls 7l == $ile.t)t
ow lets #iew the same $ile againless $ile.t)t
as we see *sing two appends the $ile.
%his function wor-s with any command that displays output
'ext up ;' program name?
example:
man pwd
ll man pages ha#e a common $ormat. hey begin with name 2the name o$ the command3 and a brie$
description o$ what it does. For e)ample the pwd command shows the $ollowing
'; 5 pwd $$ return wor-ing directory name
#@'1
-
8/10/2019 Linux Lesson 2 A
7/7
%here are ;' files for Dust about every program you can find
'ext Up