Tải bản đầy đủ

Sams linux phrasebook jun 2006 ISBN 0672328380

Linux:Phrasebook
ByScottGranneman
...............................................
Publisher:Sams
PubDate:June12,2006
PrintISBN-10:0-672-32838-0
PrintISBN-13:978-0-672-32838-1
Pages:400

TableofContents|Index

LinuxPhrasebook
issuretobecomethepocketguidethatyoukeepwithinreachatalltimes.Thisconcise,
handyreferencecanbeused"inthestreet,"justlikealanguagephrasebook.Skippingthe
usualtutorialonLinux,theLinuxPhrasebookgoesstraighttopracticalLinuxuses,
providingimmediateapplicablesolutionsforday-to-daytasks.Itincludescodephrases
thatallowLinuxuserstoemploythecommandlinetocompleteonerousandrepetitive
tasks,aswellasflexiblecodeandcommandscanbecustomizedtomeettheneedsofany
Linuxuser.TheconciseinformationcombinedwithrandomaccessibilitymakestheLinux
Phrasebookarobust,yetagile,referenceguidethatnoLinuxusershouldbewithout.



Linux:Phrasebook
ByScottGranneman
...............................................
Publisher:Sams
PubDate:June12,2006
PrintISBN-10:0-672-32838-0
PrintISBN-13:978-0-672-32838-1
Pages:400

TableofContents|Index













































Copyright
AbouttheAuthor
Acknowledgments
WeWanttoHearfromYou!
ReaderServices
Introduction
PartI:GettingStarted
Chapter1.ThingstoKnowAboutYourCommandLine
EverythingIsaFile
MaximumFilenameLengths
NamesAreCase-Sensitive
SpecialCharacterstoAvoidinNames
WildcardsandWhatTheyMean
Conclusion
Chapter2.TheBasics
ListFilesandFolders
ListtheContentsofOtherFolders
ListFolderContentsUsingWildcards
ViewaListofFilesinSubfolders
ViewaListofContentsinaSingleColumn
ViewContentsAsaComma-SeparatedList
ViewHiddenFilesandFolders
VisuallyDisplayaFile'sType
DisplayContentsinColor


















































































ListPermissions,Ownership,andMore
ReversetheOrderContentsareListed
SortContentsbyFileExtension
SortContentsbyDateandTime
SortContentsbySize
ExpressFileSizesinTermsofK,M,andG
DisplaythePathofYourCurrentDirectory
ChangetoaDifferentDirectory
ChangetoYourHomeDirectory
ChangetoYourPreviousDirectory
ChangeaFiletotheCurrentTime
ChangeaFiletoAnyDesiredTime
CreateaNew,EmptyFile
CreateaNewDirectory
CreateaNewDirectoryandAnyNecessarySubdirectories
FindOutWhatmkdirIsDoingAsItActs
CopyFiles
CopyFilesUsingWildcards
CopyFilesVerbosely
StopYourselffromCopyingoverImportantFiles
CopyDirectories
CopyFilesAsPerfectBackupsinAnotherDirectory
MoveandRenameFiles
RenameFilesandFolders
DeleteFiles
RemoveSeveralFilesAtOncewithWildcards
RemoveFilesVerbosely
StopYourselffromDeletingKeyFiles
DeleteanEmptyDirectory
RemoveFilesandDirectoriesThatAren'tEmpty
DeleteTroublesomeFiles
BecomeAnotherUser
BecomeAnotherUser,withHisEnvironmentVariables
Becomeroot
Becomeroot,withItsEnvironmentVariables
Conclusion
Chapter3.LearningAboutCommands
FindOutAboutCommandswithman
SearchforaCommandBasedonWhatItDoes

















































































QuicklyFindOutWhataCommandDoesBasedonItsName
Rebuildman'sDatabaseofCommands
ReadaCommand'sSpecificManPage
PrintManPages
LearnAboutCommandswithinfo
NavigateWithininfo
LocatethePathsforaCommand'sExecutable,SourceFiles,andManPages
ReadDescriptionsofCommands
FindaCommandBasedonWhatItDoes
FindOutWhichVersionofaCommandWillRun
Conclusion
Chapter4.BuildingBlocks
RunSeveralCommandsSequentially
RunCommandsOnlyIfthePreviousOnesSucceed
RunaCommandOnlyIfthePreviousOneFails
PlugtheOutputofaCommandintoAnotherCommand
UnderstandInput/OutputStreams
UsetheOutputofOneCommandAsInputforAnother
RedirectaCommand'sOutputtoaFile
PreventOverwritingFilesWhenUsingRedirection
AppendaCommand'sOutputtoaFile
UseaFileAsInputforaCommand
Conclusion
PartII:WorkingwithFiles
Chapter5.ViewingFiles
ViewFilesonstdout
ConcatenateFilestostdout
ConcatenateFilestoAnotherFile
ConcatenateFilesandNumbertheLines
ViewTextFilesaScreenataTime
SearchWithinYourPager
EditFilesViewedwithaPager
ViewtheFirst10LinesofaFile
ViewtheFirst10LinesofSeveralFiles
ViewtheFirstSeveralLinesofaFileorFiles
ViewtheFirstSeveralBytes,Kilobytes,orMegabytesofaFile
ViewtheLast10LinesofaFile
ViewtheLast10LinesofSeveralFiles
ViewtheLastSeveralLinesofaFileorFiles

















































































ViewtheConstantlyUpdatedLastLinesofaFileorFiles
Conclusion
Chapter6.PrintingandManagingPrintJobs
ListAllAvailablePrinters
DetermineYourDefaultPrinter
FindOutHowYourPrintersAreConnected
GetAlltheInformationAboutYourPrintersatOnce
PrintFilestotheDefaultPrinter
PrintFilestoAnyPrinter
PrintMoreThanOneCopyofaFile
ListPrintJobs
ListPrintJobsbyPrinter
CanceltheCurrentPrintJobSenttotheDefaultPrinter
CancelaPrintJobSenttoAnyPrinter
CancelAllPrintJobs
Conclusion
Chapter7.OwnershipsandPermissions
ChangetheGroupOwningFilesandDirectories
RecursivelyChangetheGroupOwningaDirectory
KeepTrackofChangesMadetoaFile'sGroupwithchgrp
ChangetheOwnerofFilesandDirectories
ChangetheOwnerandGroupofFilesandDirectories
UnderstandtheBasicsofPermissions
ChangePermissionsonFilesandDirectoriesUsingAlphabeticNotation
ChangePermissionsonFilesandDirectoriesUsingNumericPermissions
ChangePermissionsRecursively
SetandThenClearsuid
SetandThenClearsgid
SetandThenCleartheStickyBit
Conclusion
Chapter8.ArchivingandCompression
ArchiveandCompressFilesUsingzip
GettheBestCompressionPossiblewithzip
Password-ProtectCompressedZipArchives
UnzipFiles
ListFilesThatWillBeUnzipped
TestFilesThatWillBeUnzipped
ArchiveandCompressFilesUsinggzip
ArchiveandCompressFilesRecursivelyUsinggzip
















































































GettheBestCompressionPossiblewithgzip
UncompressFilesCompressedwithgzip
TestFilesThatWillBeUnzippedwithgunzip
ArchiveandCompressFilesUsingbzip2
GettheBestCompressionPossiblewithbzip2
UncompressFilesCompressedwithbzip2
TestFilesThatWillBeUnzippedwithbunzip
ArchiveFileswithtar
ArchiveandCompressFileswithtarandgzip
TestFilesThatWillBeUntarredandUncompressed
UntarandUncompressFiles
Conclusion
PartIII:FindingStuff
Chapter9.FindingStuff:Easy
SearchaDatabaseofFilenames
SearchaDatabaseofFilenamesWithoutWorryingAboutCase
ManageResultsReceivedWhenSearchingaDatabaseofFilenames
UpdatetheDatabaseUsedbylocate
SearchingInsideTextFilesforPatterns
TheBasicsofSearchingInsideTextFilesforPatterns
SearchRecursivelyforTextinFiles
SearchforTextinFiles,IgnoringCase
SearchforWholeWordsOnlyinFiles
ShowLineNumbersWhereWordsAppearinFiles
SearchtheOutputofOtherCommandsforSpecificWords
SeeContextforWordsAppearinginFiles
ShowLinesWhereWordsDoNotAppearinFiles
ListFilesContainingSearched-forWords
SearchforWordsInsideSearchResults
Conclusion
Chapter10.ThefindCommand
FindFilesbyName
FindFilesbyOwnership
FindFilesbyGroupOwnership
FindFilesbyFileSize
FindFilesbyFileType
ShowResultsIftheExpressionsAreTrue(AND)
ShowResultsIfEitherExpressionIsTrue(OR)
ShowResultsIftheExpressionIsNotTrue(NOT)














































































ExecuteaCommandonEveryFoundFile
PrintFindResultsintoaFile
Conclusion
PartIV:Environment
Chapter11.YourShell
ViewYourCommand-LineHistory
RuntheLastCommandAgain
RunaPreviousCommandUsingNumbers
RunaPreviousCommandUsingaString
DisplayAllCommandAliases
ViewaSpecificCommandAlias
CreateaNewTemporaryAlias
CreateaNewPermanentAlias
RemoveanAlias
Conclusion
Chapter12.MonitoringSystemResources
ViewAllCurrentlyRunningProcesses
ViewaProcessTree
ViewProcessesOwnedbyaParticularUser
EndaRunningProcess
ViewaDynamicallyUpdatedListofRunningProcesses
ListOpenFiles
ListaUser'sOpenFiles
ListUsersforaParticularFile
ListProcessesforaParticularProgram
DisplayInformationAboutSystemRAM
ShowFileSystemDiskUsage
ReportFileSpaceUsedbyaDirectory
ReportJusttheTotalSpaceUsedforaDirectory
Conclusion
Chapter13.InstallingSoftware
InstallSoftwarePackagesforRPM-BasedDistributions
RemoveSoftwarePackagesforRPM-BasedDistributions
InstallSoftwarePackagesandDependenciesforRPM-BasedDistributions
RemoveSoftwarePackagesandDependenciesforRPM-BasedDistributions
UpgradeSoftwarePackagesandDependenciesforRPM-BasedDistributions
FindPackagesAvailableforDownloadforRPM-BasedDistributions
InstallSoftwarePackagesforDebian




RemoveSoftwarePackagesforDebian



InstallSoftwarePackagesandDependenciesforDebian










































































RemoveSoftwarePackagesandDependenciesforDebian
UpgradeSoftwarePackagesandDependenciesforDebian
FindPackagesAvailableforDownloadforDebian
CleanUpUnneededInstallationPackagesforDebian
TroubleshootProblemswithapt
Conclusion
PartV:Networking
Chapter14.Connectivity
ViewtheStatusofYourNetworkInterfaces
VerifyThataComputerIsRunningandAcceptingRequests
TracetheRoutePacketsTakeBetweenTwoHosts
PerformDNSLookups
ConfigureaNetworkInterface
ViewtheStatusofYourWirelessNetworkInterfaces
ConfigureaWirelessNetworkInterface
GrabaNewAddressUsingDHCP
MakeaNetworkConnectionActive
BringaNetworkConnectionDown
DisplayYourIPRoutingTable
ChangeYourIPRoutingTable
TroubleshootingNetworkProblems
Conclusion
Chapter15.WorkingontheNetwork
SecurelyLogIntoAnotherComputer
SecurelyLogIntoAnotherMachineWithoutaPassword
SecurelyTransferFilesBetweenMachines
SecurelyCopyFilesBetweenHosts
SecurelyTransferandBackUpFiles
DownloadFilesNon-interactively
DownloadWebsitesNon-interactively
DownloadSequentialFilesandInternetResources
Conclusion
Chapter16.WindowsNetworking
DiscovertheWorkgroup'sMasterBrowsers
QueryandMapNetBIOSNamesandIPAddresses
ListaMachine'sSambaShares




AccessSambaResourceswithanFTP-LikeClient




MountaSambaFilesystem
Conclusion



Index


Copyright
LinuxPhrasebook
Copyright©2006bySamsPublishing
Allrightsreserved.Nopartofthisbookshallbereproduced,
storedinaretrievalsystem,ortransmittedbyanymeans,
electronic,mechanical,photocopying,recording,orotherwise,
withoutwrittenpermissionfromthepublisher.Nopatent
liabilityisassumedwithrespecttotheuseoftheinformation
containedherein.Althougheveryprecautionhasbeentakenin
thepreparationofthisbook,thepublisherandauthorassume
noresponsibilityforerrorsoromissions.Norisanyliability
assumedfordamagesresultingfromtheuseoftheinformation
containedherein.
InternationalStandardBookNumber:0-672-32838-0
LibraryofCongressCatalogCardNumber:2005904028
PrintedintheUnitedStatesofAmerica
FirstPrinting:June2006
090807064321

Trademarks
Alltermsmentionedinthisbookthatareknowntobe
trademarksorservicemarkshavebeenappropriately
capitalized.SamsPublishingcannotattesttotheaccuracyof
thisinformation.Useofaterminthisbookshouldnotbe
regardedasaffectingthevalidityofanytrademarkorservice
mark.


WarningandDisclaimer
Everyefforthasbeenmadetomakethisbookascompleteand
asaccurateaspossible,butnowarrantyorfitnessisimplied.
Theinformationprovidedisonan"asis"basis.

BulkSales
SamsPublishingoffersexcellentdiscountsonthisbookwhen
orderedinquantityforbulkpurchasesorspecialsales.For
moreinformation,pleasecontact

U.S.CorporateandGovernmentSales
1-800-382-3419
corpsales@pearsontechgroup.com
ForsalesoutsideoftheU.S.,pleasecontact

InternationalSales
international@pearsoned.com
AcquisitionsEditor
JennyWatson
DevelopmentEditors
SonglinQiuScottMeyers
ManagingEditor
GinaKanouse


ProjectEditor
GeorgeE.Nedeff
CopyEditor
HeatherWilkins
Indexer
JohnBickelhaupt
Proofreader
JessicaMcCarty
TechnicalEditor
TimothyBoronczyk
PublishingCoordinator
VanessaEvans
MultimediaDeveloper
DanScherf
BookDesigner
GaryAdair
PageLayout
BronkellaPublishingLLC

Dedication


ThebookisdedicatedtoLinuxusers,botholdandnew.
Welcome!


AbouttheAuthor
ScottGrannemanisanauthor,educator,andconsultant.Asa
writer,hefocusesonopensourcesoftware,asshownbyhis
firsttwobooks,Don'tClickontheBlueE!:SwitchingtoFirefox
andHackingKnoppix,andhiscontributionstoUbuntuHacks.In
addition,heisamonthlycolumnistforSecurityFocus,with
op/edpiecesthatfocusongeneralsecuritytopics,andforLinux
Magazine,inacolumnfocusingonnewandinterestingLinux
software,andheblogsprofessionallyonTheOpenSource
Weblog.
AnAdjunctProfessoratWashingtonUniversityinSt.Louis,
Scottteachesavarietyofcoursesabouttechnologyandthe
Internet.Asaneducator,hehastaughtthousandsofpeopleof
allagesfrompreteenstoseniorcitizensonawidevarietyof
topics,includingliterature,education,andtechnology.Withthe
shiftinfocusoverthelastdecadetoLinuxandotheropensourcetechnologies,Scotthasworkedtobringknowledgeof
thesepowerfulnewdirectionsinsoftwaretopeopleatall
technicalskilllevels.
AsaPrincipalofWebSanity,awebsitecreationandhostingfirm,
heworkswithbusinessesandnonprofitstoleveragethe
Internet'scommunication,sales,andserviceopportunities.He
managesthefirm'sUnix-basedserverenvironment,thereby
puttingwhathewritesandteachesintopracticaluse,and
workscloselywithotherpartnersanddevelopersonthe
underlyingWebSanityContentManagementSystem(CMS)
softwareanditsextensions.




Acknowledgments
NoonelearnsabouttheLinuxshellinavacuum,andIhave
hundredsofwriters,workingoverthelastseveraldecades,to
thankforeducatingmeabouttheawesomepossibilities
providedbytheLinuxcommandline.Books,websites,blogs,
handoutsatLUGmeetings:Allhelpedmelearnaboutbash,and
theycontinuetoteachmetoday.IfIcangivebackjusta
fractionofwhatIhaveabsorbed,I'llbesatisfied.
Inadditiontothatgeneralpoolofknowledgeableindividuals,
I'dliketothankthepeople(andanimals)whogavemehelp
andsupportduringthewritingofLinuxPhrasebook.
Myagent,LauraLewin,whohasbeenhelpfulintoomanyways
formetorecount.
MyeditorsatPearson,whogavemetheopportunitytowrite
thisbookinthefirstplaceandhaveencouragedmewheneverI
neededprodding.
RobertCitekprovidedinvaluablehelpwithRPM,andwasalways
thereifIhadaquestion.ThatmanknowsLinux.
MybusinesspartnerandlifelongbuddyJansCartonhelpedme
focuswhenIneededit,andwasa(mostly)willingguineapig
formanynewcommandsandoptions.Lookingbackatthatday
infifthgradewhenwemet,who'dathunkit?
JerryBryanlookedovereverythingIwroteandfixedallthe
littlegrammaticalmistakesandtyposImade.Ipromise,Jerry:
OnedayI'lllearnthedifferencebetween"may"and"might!"
Mywife,DeniseLieberman,patientlylistenedtomebabble
excitedlywheneverIfiguredoutsomethingcool,eventhough
shehadabsolutelynoideawhatIwastalkingabout.That'strue


love.Thanks,Denise!
Finally,Imustpointtomycutelil'ShihTzuLibby,whoalways
knewexactlytherighttimetoputherfrontpawsonmylegand
demandearscratchesandbellyrubs.




WeWanttoHearfromYou!
Asthereaderofthisbook,youareourmostimportantcritic
andcommentator.Wevalueyouropinionandwanttoknow
whatwe'redoingright,whatwecoulddobetter,whatareas
you'dliketoseeuspublishin,andanyotherwordsofwisdom
you'rewillingtopassourway.
Youcanemailorwritemedirectlytoletmeknowwhatyoudid
ordidn'tlikeaboutthisbookaswellaswhatwecandotomake
ourbooksstronger.
PleasenotethatIcannothelpyouwithtechnicalproblems
relatedtothetopicofthisbook,andthatduetothehigh
volumeofmailIreceive,Imightnotbeabletoreplytoevery
message.
Whenyouwrite,pleasebesuretoincludethisbook'stitleand
authoraswellasyournameandphoneoremailaddress.Iwill
carefullyreviewyourcommentsandsharethemwiththeauthor
andeditorswhoworkedonthebook.

Email: opensource@samspublishing.com





Mail:

MarkTaber






AssociatePublisher
SamsPublishing
800East96thStreet
Indianapolis,IN46240USA


ReaderServices
Visitourwebsiteandregisterthisbookat
www.samspublishing.com/registerforconvenientaccesstoany
updates,downloads,orerratathatmightbeavailableforthis
book.


Introduction
AmongkeyLinuxfeatures,thecommand-lineshellisoneofthe
mostimportant.IfyourunaLinuxserver,yourmaininterface
ismorethanlikelygoingtobetheshell.Ifyou'reapoweruser
runningLinuxonthedesktop,youprobablyhaveaterminal
openatalltimes.Ifyou'reaLinuxnewbie,youmaythinkthat
you'llneveropenupthecommandline,butyouwillsometime
...andthemoreyouuseLinux,themoreyou'regoingtowant
tousethatshell.
TheshellinmanywaysisthekeytoLinux'spowerand
elegance.Youcandothingswiththecommandlinethatyou
simplycan'tdowithwhateverGUIyoufavor.Nomatterhow
powerfulKDEorGNOMEmaybe(orIceWMorXFCEoranyof
theotherkajillionwindowingenvironmentsoutthere),youwill
alwaysbeabletodomanythingsfasterandmoreefficiently
withaterminal.IfyouwanttomasterLinux,youneedtobegin
bymasteringtheLinuxcommandline.
ThetraditionalmethodhasbeentousetheLinuxmanpages.
Whilemanpagesareuseful,theyareoftennotenough,forone
simplereason:Theylackexamples.Oh,afewmanpageshere
andtherehaveafewexamples,butbyandlarge,examplesare
hardtocomeby.Thispresentsarealproblemforusersatall
experiencelevels:It'sonethingtoseeoptionslistedand
explained,butit'sanotherthingentirelytoseethoseoptions
usedinrealworldsituations.
Thisbookisallaboutthosemissingexamples.I'vebeenusing
LinuxforoveradecadeandIconsidermyselfpretty
knowledgeableaboutmyfavoriteoperatingsystem.Ontopof
that,I'msoaddictedtothecommandlinethatIhaveKDEset
uptoautomaticallystartKonsole,theKDEterminal,whenIlog
in.ButI'malwayslamentingwithotherLinuxusersthedearth
ofexamplesfoundinmanpages.WhenIwasaskedtowrite


LinuxPhrasebook,andtoldthatitwastoconsistofhundredsof
examplesillustratingthemostimportantLinuxcommands,I
replied,"Ican'twait!That'sabookI'dbuyinaheartbeat!"
You'reholdingtheresultinyourhands:abookabouttheLinux
commandsyoujusthavetoknow,withexamplesillustrating
howtouseeachandeveryone.Thisisareferencebookthat
willbeusefulnowandforyearstocome,butIalsohopeyou
finditenjoyableaswell,andevenalittlefun.

AudienceforThisBook
I'vewrittenthisbooktobeusefulbothtobeginnersthefolks
thatshowuptomeetingsofourLinuxUsersGroupseeking
guidanceandahelpinghandastheybegintheadventureof
usingLinuxandtoexperienceduserswhousetheshellfor
everythingfromsystemsadministrationtogamesto
programming.Ifyou'vejuststartedusingLinux,thisbookwill
helpteachyouabouttheshellanditspower;ifyou'vebeen
usingLinuxforyearsandyears,LinuxPhrasebookwillstill
teachyousomenewtricksandremindyouofsomefeatures
you'dlongagoforgotten.
Therearemanyshellsouttherecsh,tcsh,zsh,tonamebuta
fewbutIusethedefaultshellforvirtuallyeveryLinuxdistro:
bash,theBourneAgainShell.Thebashshellisnotonly
ubiquitous,butalsoamazinglypowerfulandflexible.Afteryou
getcomfortablewithbash,youmaychoosetoexploreother
options,butknowledgeofbashisrequiredintheworldofLinux.
IwrotethisbookusingK/Ubuntu,butthecommandsdiscussed
shouldworkonyourdistroaswell.Theonlymajordifference
comeswhenyourunacommandasroot.Insteadofloggingin
asroot,K/Ubuntuencouragestheuseofthesudocommand;in
otherwords,insteadofrunninglsoffirefoxasroot,aK/Ubuntu
userwouldrunsudolsoffirefox.


Inordertoappealtothewidestnumberofreadersoutthere,I
showedthecommandsasthoughyouhavetorunthemasroot,
withoutsudo.Ifyouseea#infrontofacommand,that'sthe
shellindicatingthatrootisloggedin,whichmeansyouneedto
beroottorunthatcommand,orutilizesudoifyou'reusing
K/Ubuntuorasimilardistro.

ConventionsUsedinThisbook
Thisbookusesthefollowingconventions.
Monospacetypeisusedtodifferentiatebetween

code/programming-relatedtermsandregularEnglish,and
toindicatetextthatshouldappearonyourscreen.For
example:
Thedfcommandshowsresultsinkilobytesbydefault,but
it'susuallyeasiertocomprehendifyouinsteadusethe-h
(or--human-readable)option.

Itwilllooklikethistomimicthewaytextlooksonyours
Anarrow( )atthebeginningofalineofcodemeansthat
asinglelineofcodeistoolongtofitontheprintedpage.It
signifiestoreadersthattheauthormeantforthecontinued
codetoappearonthesameline.Manyofthecode
examplesinthisbookhavebeentruncatedduetolength.
Inadditiontothis,thefollowingelementsareusedto
introduceotherpertinentinformationusedinthisbook.
ANotepresentsinterestingpiecesofinformation
relatedtothesurroundingdiscussion.


ATipoffersadviceorteachesaneasierwaytodo
something.

ACautionadvisesyouaboutpotentialproblemsand
helpsyousteerclearofdisaster.




PartI:GettingStarted
Chapter1.ThingstoKnowAboutYourCommandLine
Chapter2.TheBasics
Chapter3.LearningAboutCommands
Chapter4.BuildingBlocks


Chapter1.ThingstoKnowAboutYour
CommandLine
Beforeyoureallydigintoyourbashshell,youfirstneedto
understandafewthingsthatwillhelpyouasyouproceed
throughoutthisbook.Thesearesomeabsolutesthatyoujust
gottaknow,and,trickily,someofthemarenotobviousatall.
Butafteryouunderstandthem,someofthewaysinwhichyour
shellbehaveswillstartmakingmuchmoresense.


EverythingIsaFile
OnaLinuxsystem,everythingisafileeverything,whichmay
seemobviousatfirst.Ofcourseatextdocumentisafile,and
soisanOpenOffice.orgdocument,anddon'tforgetapicture,
anMP3,andavideo.Ofcourse!
Butwhataboutadirectory?It'safile,tooaspecialkindoffile
thatcontainsinformationaboutotherfiles.Diskdrivesare
reallybigfiles.Networkconnectionsarefiles.Evenrunning
processesarefiles.It'sallfiles.
ToLinux,afileisjustastreamofbitsandbytes.Linuxdoesn't
carewhatthosebitsandbytesform;instead,theprograms
runningonLinuxcare.ToLinux,atextdocumentandanetwork
connectionarebothfiles;it'syourtexteditorthatknowshowto
workwiththetextdocument,andyourInternetapplications
thatrecognizethenetworkconnection.
ThroughoutthisbookI'mgoingtorefertofiles.Ifit's
appropriate,feelfreetoreadthatas"filesanddirectoriesand
subdirectoriesandeverythingelseonthesystem."Inparticular,
manyofthecommandsI'llcoverworkequallywellon
documentsanddirectories,sofeelfreetotryouttheexamples
onboth.


Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay

×