devexpress asp.net pdf viewer : Delete page from pdf online SDK control service wpf web page .net dnn AppleShellScripting-201425-part666

Tosolvethisproblem,alwaysusethe
mktemp
commandtocreatetemporaryfiles.The
mktemp
command
createsfileswithinitialpermissionsof0600,andneverreturnsanexistingfile.(Using
mktemp
alsoprovides
aneasywaytoobtainaknown-uniquefilename,potentiallyavoidingunexpectedbehaviorcausedbytemp
filecollisions.)
Important:  AlthoughOSXdoesnotuseaprivilegedhelpertocleanuptemporaryfiles(exceptduringa
reboot),someoperatingsystemsdo.Ifascriptcouldpotentiallytakealongtimetoexecutewithout
modifyingatemporaryfile,suchprivilegedcleanuphelperscanopenupasecurityvulnerabilitybydeleting
theexistingtempfileoutfromunderyourscript.
Becauseofthisrisk,system-providedtemporarydirectoriesshouldonlybeusedtostoresensitivedata
briefly.Youshoulddoaslittleworkaspossiblebetweencreatingthefileandusingit,andshouldcleanup
thefileassoonaspossibleafterwards.
Further,ifyoususpendyourscriptsforanysignificantperiodoftime,yourscriptsmustcreateanysensitive
temporaryfilesinanon-world-writabledirectory.
Youshouldavoidwritingsensitivedataouttotemporaryfilesatallifyoucanpossiblyavoidit.
FlagsThatAffectSecurity(andCorrectness)
The
set
builtin(describedinthe
sh
manpage)setsanumberofshellfeaturesthatcanbeusedtoreducethe
riskposedbycertaintypesofcommonprogrammingmistakes.Theseflagsallowyourscriptstoautomatically
exitifanunsetvariableisexpanded,automaticallyexitifanysimplecommandsfail,orautomaticallyexport
variables.
Inaddition,theBASHshellprovidesaflagthatcausespipestoreturnanonzeroexitstatuswhenanycommand
inthechainofpipesexitswithanerrorinsteadofalwaysreturningtheexitstatusofthelastcommand.Italso
supportsaflagthatlimitstheeffectofenvironmentvariablesontheinterpreter,intendedforuseinscripts
thatareexpectedtoberunasaprivilegeduser(forexample,the
root
user).
DetectingUnsetVariables
Bydefault,theBourneshelltreatsunsetvariablesasempty(unlike
csh
).Ifyourscriptexpectsthatunsetvariable
tocontainavalue,thiscanleadtoincorrectscriptexecutionand,dependingonthescript,mayevenresultin
asecurityhole.Toguardagainstthis,youcanissuethefollowingcommand:
set -u
Withthisflagset,ifyourscripttriestouseanemptyvariable,theshellprintsanerrormessage,andtheentire
scriptexitsimmediatelywithanonzeroexitstatus.
ShellScriptSecurity
FlagsThatAffectSecurity(andCorrectness)
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
251
Delete page from pdf online - SDK control service:C# PDF Page Extract Library: copy, paste, cut PDF pages in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Easy to Use C# Code to Extract PDF Pages, Copy Pages from One PDF File and Paste into Others
www.rasteredge.com
Delete page from pdf online - SDK control service:VB.NET PDF Page Extract Library: copy, paste, cut PDF pages in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
Detailed VB.NET Guide for Extracting Pages from Microsoft PDF Doc
www.rasteredge.com
Note:  Ifyourscriptchangesitsbehaviordeliberatelybasedonthepresenceorabsenceofoneor
moreenvironmentvariables,youshouldtypicallyperformthosetestsbeforeyousetthisflag.
Ifdesired,youcanlaterrestorethedefaultbehaviorwiththefollowingcommand:
set +u
CheckingExitStatusAutomatically
Forverysimplescripts,checkingtheexitstatusofeachcommandcanbetedious.Youcangreatlysimplify
thesescriptsbyinsteadissuingthefollowingcommand:
set -e
Withthisflagset,ifanysimplecommandexitswithanonzeroexitstatus,theshellterminateswiththat
command’sexitstatus.Asimplecommandisdefinedasacommandthatincludesnopipesorlists,thatisnot
executedaspartofacontrolstatement,andwhoseexitstatusisnotinvertedwithanexclamationpoint.
Important:  Becausetherearemanysituationsinwhicherrorscanbemasked(particularlyinpipesand
lists),thisflagisnotasubstituteforpropererrorcheckingincomplexscripts.
Ifdesired,youcanlaterrestorethedefaultbehaviorwiththefollowingcommand:
set +e
ExportingVariablesAutomatically
Itisnotalwaysnecessarytoexportvariablesthatyourscriptusesinternally.However,ifachildprocessdepends
onthevaluesofthosevariables,theymustbeexported.Insomecases,failingtoexportavariablecouldeven
resultinasecurityholeifitcausesthechildtograntauseraccessthatheorshewouldotherwisenothave.
Forexample,ifaCGIscriptrunninginawebserverenvironmentprovidesadditionallimitsonwhatfilesa
remoteusercanaccess,abuginthatscriptmightgivetheuseraccesstootherfiles.
Youcan,ifdesired,telltheshelltoautomaticallyexportanyvariablethatyourscriptsetsbyissuingthefollowing
command:
set -a
ShellScriptSecurity
FlagsThatAffectSecurity(andCorrectness)
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
252
SDK control service:VB.NET PDF Page Delete Library: remove PDF pages in vb.net, ASP.
Online source codes for quick evaluation in VB.NET class. If you are looking for a solution to conveniently delete one page from your PDF document, you can use
www.rasteredge.com
SDK control service:C# PDF Page Delete Library: remove PDF pages in C#.net, ASP.NET
Advanced component and library able to delete PDF page in both Visual C# .NET WinForms and ASP.NET WebForms project. Free online C# class source code for
www.rasteredge.com
Warning:  Automaticallyexportingvariablescanalsocauseasecurityholebyexportingvariables
containingsensitivedata,suchasinternalpasswordsandapplicationkeys,intotheenvironmentsof
everycommandthatyourscriptexecutes.Iftheoutputofthosecommandscouldbeseenbyan
untrusteduser—commandsexecutedbyaCGIscript,forexample—thenyouriskleakingsensitive
data.Forthisreason,youshouldavoidsettingthisflagifyourscriptcontainsanysensitivedata,such
asinternalpasswordsorapplicationkeys.
Ifdesired,youcanlaterrestorethedefaultbehaviorwiththefollowingcommand:
set +a
RetrievingtheExitStatusofPipedCommandsinBASH
Theexitstatusofaseriesofcommandsconnectedbypipesis,bydefault,theexitstatusoftherightmost
command.Ifyoudonotexaminetheoutputfromthefinalcommandtoensurethatitmakessense,thisdefault
behaviorcanpotentiallymaskerrorsthatmightleadtosecurityproblems.
Forexample,considerthefollowingcode:
ls nonexistentfile | cat
echo $?
Inthefirstcommand,eventhoughthe
ls
commandfails,thecatcommanddoesnotcarewhetheritreceived
anyinputornot,andthusexitswithazeroexitstatus.Asaresult,thepipe’sexitstatusiszero.Ifitiscritical
toknowwhetherthefirstcommandfailed(forexample,ifitperformsanoperationwithanimportantside
effect,suchasremovingafileondisk),thenthisispotentiallyunsafe.
Therearemanywaysthatyoucanfixthisproblem.Themostobviousfixistostoretheresultsofthefirst
commandintoavariabletemporarily,checktheresultcodeofthefirstcommand,andthenuse
echo
topipe
theresultstothesecondcommand.Thistechniqueisoftenlessthanidealforcommandsthattakealongtime
toexecuteorproducelargeamountsofoutput,however,becausethesecondcommanddoesnotreceiveany
datauntilafterthefirstcommandexits.Theperformanceimpactisparticularlynoticeableiftheoutputofthe
finalcommandisexpectedtobereadbytheuser.
Asanalternative,inBASH,youcanissuethefollowingcommandbeforeissuingthecommandsabove:
set -o pipefail
ShellScriptSecurity
FlagsThatAffectSecurity(andCorrectness)
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
253
SDK control service:C# PDF File & Page Process Library SDK for C#.net, ASP.NET, MVC
Provides you with examples for adding an (empty) page to a PDF and adding empty pages You may feel free to define some continuous PDF pages and delete.
www.rasteredge.com
SDK control service:C# HTML5 PDF Viewer SDK to view PDF document online in C#.NET
RasterEdge. PRODUCTS: ONLINE DEMOS: Online HTML5 Document Viewer; Online XDoc.PDF C# File: Split PDF; C# Page: Insert PDF pages; C# Page: Delete PDF pages;
www.rasteredge.com
Afterissuingthiscommand,thepipe’sexitstatusisprovidedbytherightmostcommandthatfailedwitha
nonzeroexitstatus,orzeroifeverycommandinthechainofpipesexitedsuccessfully.Intheearlierexample,
thefinal
echo
commandwouldprintthenumber
1
(theexitstatusofthe
ls
command).
Note:  ThisfeatureisspecifictoBASHandisnotsupportedbyotherBourneshellimplementations.
Ifyouusethisfeature,youshouldchangetheinterpreterlinetothefollowing:
#!/bin/bash
Ifyouarewritingascriptthatmustbeportabletoother
sh
implementations,youcannotusethis
setting.Instead,eitherstoretheresultsinanintermediatevariableorfile,orcheckthefinalresult
carefullytoensurethatitmakessense.
Ifdesired,youcanlaterrestorethedefaultbehaviorwiththefollowingcommand:
set +o pipefail
SanitizingtheEnvironmentinBASH
ForBASHshellscripts(orBourneshellscriptsrunninginBASH)thatmustruninaprivilegedenvironment(as
the
root
user,forexample),itisagoodideatotelltheshelltonotautomaticallyexecuteany“runcommands”
files(
.bashrc
,
.profile
,andsoon)thatmaycontainaliascommandsthataffectscriptexecution,functions
thatmayoverridecommandsinyourscript,orevenmaliciouscommandsthatanattackerwantsyourscript
toexecutewhilerunningasthe
root
user.
Tosanitizethescript’senvironmentinthisway,youshouldchangeyourscript’sinterpreterlinetothefollowing:
#!/bin/bash -p
Inthismode,thescriptsreferencedbythe
ENV
and
BASH_ENV
environmentvariablesarenotexecuted,shell
functionsarenotinherited,andthe
SHELLOPTS
environmentvariableisignored.
Note:  Althoughyoucantheoreticallysetthisvaluewiththe
set
builtin,bythetimeyourscript
actuallystartsrunningcommands,thedamageisalreadydone.Forthisreason,youshouldalways
setthisflagintheinterpreterline.
Also,youshouldbeawarethatthisflagisspecifictoBASH,andisnotbroadlyavailableinother
shells.
ShellScriptSecurity
FlagsThatAffectSecurity(andCorrectness)
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
254
SDK control service:C# PDF Page Insert Library: insert pages into PDF file in C#.net
Free components and online source codes for .NET framework 2.0+. PDF document files by C# code, how to rotate PDF document page, how to delete PDF page using C#
www.rasteredge.com
SDK control service:VB.NET PDF- View PDF Online with VB.NET HTML5 PDF Viewer
RasterEdge. PRODUCTS: ONLINE DEMOS: Online HTML5 Document Viewer; Online XDoc.PDF C# File: Split PDF; C# Page: Insert PDF pages; C# Page: Delete PDF pages;
www.rasteredge.com
Historically,thecommandlineinterfaceprovidedawaytomanipulateacomputeroversimple,text-based
connections.Inthemodernera,inspiteoftheabilitytotransmitgraphicaluserinterfacesovertheInternet,
thecommandlineremainsapowerfultoolforperformingcertaintypesoftasks.
AsdescribedpreviouslyinBeforeYouBegin (page 15),mostusersinteractwithacommand-lineenvironment
usingtheTerminalapplication,thoughyoumayalsousearemoteconnectionmethodsuchassecureshell
(SSH).EachTerminalwindoworSSHconnectionprovidesaccesstotheinputandoutputofashellprocess.A
shellisaspecialcommand-linetoolthatisdesignedspecificallytoprovidetext-basedinteractivecontrolover
othercommand-linetools.
Inadditiontorunningindividualtools,mostshellsprovidesomemeansofcombiningmultipletoolsinto
structuredprograms,calledshellscripts(thesubjectofthisbook).
Differentshellsfeatureslightlydifferentcapabilitiesandscriptingsyntax.Althoughyoucanuseanyshellof
yourchoice,theexamplesinthisbookassumethatyouareusingthestandardOSXshell.Thestandardshell
is
bash
ifyouarerunningOSXv10.3orlaterand
tcsh
ifyouarerunninganearlierversionoftheoperating
system.
Thefollowingsectionsprovidesomebasicinformationandtipsaboutusingthecommand-lineinterfacemore
effectively;theyarenotintendedasanexhaustivereferenceforusingtheshellenvironments.
Note:  ThisappendixwasoriginallypartofMacTechnologyOverview.
BasicShellConcepts
Beforeyoustartworkinginanyshellenvironment,therearesomebasicfeaturesofshellscriptingthatyou
shouldunderstand.SomeofthesefeaturesarespecifictoOSX,butmostarecommontoallplatformsthat
supportshellscripting.
RunningYourFirstCommand-LineTool
Ingeneral,youruncommand-linetoolsthatOSXprovidesbytypingthenameofthetool.(Thesyntaxfor
runningtoolsthatyou’veaddedisdescribedlaterinthisappendix.)
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
255
Command Line Primer
SDK control service:VB.NET PDF Page Insert Library: insert pages into PDF file in vb.
in VB.NET. Ability to create a blank PDF page with related by using following online VB.NET source code. Support .NET WinForms, ASP
www.rasteredge.com
SDK control service:VB.NET PDF - Convert PDF Online with VB.NET HTML5 PDF Viewer
RasterEdge. PRODUCTS: ONLINE DEMOS: Online HTML5 Document Viewer; Online XDoc.PDF C# File: Split PDF; C# Page: Insert PDF pages; C# Page: Delete PDF pages;
www.rasteredge.com
Forexample,ifyourunthe
ls
command,bydefault,itliststhefilesinyourhomedirectory.Torunthiscommand,
type
ls
andpressReturn.
Mosttoolsalsocantakeanumberofflags(sometimescalledswitches).Forexample,youcangeta“long”file
listing(withadditionalinformationabouteveryfile)bytyping
ls -l
andpressingReturn.The
-l
flagtells
the
ls
commandtochangeitsdefaultbehavior.
Similarly,mosttoolstakearguments.Forexample,toshowalonglistingofthefilesonyourOSXdesktop,
type
ls -l Desktop
andpressReturn.Inthatcommand,theword
Desktop
isanargumentthatisthename
ofthefolderthatcontainsthecontentsofyourOSXdesktop.
Inaddition,sometoolshaveflagsthattakeflag-specificargumentsinadditiontothemainargumentstothe
toolasawhole.
SpecifyingFilesandDirectories
Mostcommandsintheshelloperateonfilesanddirectories,thelocationsofwhichareidentifiedbypaths.
Thedirectorynamesthatmakeupapathareseparatedbyforward-slashcharacters.Forexample,theTerminal
programisinthe
Utilities
folderwithinthe
Applications
folderatthetoplevelofyourharddrive.Its
pathis
/Applications/Utilities/Terminal.app
.
Theshell(alongwith,forthatmatter,allotherUNIXapplicationsandtools)alsohasanotionofacurrent
workingdirectory.Whenyouspecifyafilenameorpaththatdoesnotstartwithaslash,thatpathisassumed
toberelativetothisdirectory.Forexample,ifyoutype
cat foo
,the
cat
commandprintsthecontentsof
thefile
foo
inthecurrentdirectory.Youcanchangethecurrentdirectoryusingthe
cd
command.
Finally,theshellsupportsanumberofdirectorynamesthathaveaspecialmeaning.
TableA-1listssomeofthestandardshortcutsusedtorepresentspecificdirectoriesinthesystem.Because
theyarebasedoncontext,theseshortcutseliminatetheneedtotypefullpathsinmanysituations.
TableA-1
Specialpathcharactersandtheirmeaning
Description
Path
string
The
.
directory(singleperiod)isaspecialdirectorythat,whenaccessed,pointstothecurrent
workingdirectory.Thisvalueisoftenusedasashortcuttoeliminatetheneedtotypeina
fullpathwhenrunningacommand.
Forexample,ifyoutype
./mytool
andpressreturn,youarerunningthe
mytool
command
inthecurrentdirectory(ifsuchatoolexists).
.
CommandLinePrimer
BasicShellConcepts
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
256
SDK control service:VB.NET PDF - Annotate PDF Online with VB.NET HTML5 PDF Viewer
Ability to insert a text note after selected text. Allow users to draw freehand shapes on PDF page. VB.NET HTML5 PDF Viewer: Annotate PDF Online.
www.rasteredge.com
SDK control service:C# HTML5 PDF Viewer SDK to annotate PDF document online in C#.NET
Ability to insert a text note after selected text. Allow users to draw freehand shapes on PDF page. C# HTML5 PDF Viewer: Annotate PDF Online.
www.rasteredge.com
Description
Path
string
The
..
directory(twoperiods)isaspecialdirectorythat,whenaccessed,pointstothe
directorythatcontainsthecurrentdirectory(calleditsparentdirectory).Thisdirectoryisused
fornavigatinguponeleveltowardsthetopofthedirectoryhierarchy.
Forexample,thepath
../Test
isafileordirectory(named
Test
)thatisasiblingofthe
currentdirectory.
Note:Dependingontheshell,ifyoufollowasymboliclinkintoasubdirectory,typing
cd
..
directorywilleithertakeyoubacktothedirectoryyoucamefromorwilltakeyoutothe
parentofthecurrentdirectory.
..
Atthebeginningofapath,thetildecharacterrepresentsthehomedirectoryofthespecified
user,orthecurrentlyloggedinuserifnouserisspecified.(Unlike
.
and
..
,thisisnotan
actualdirectory,butasubstitutionperformedbytheshell.)
Forexample,youcanrefertothecurrentuser’s
Documents
folderas
~/Documents
.Similarly,
ifyouhaveanotheruserwhoseshortnameis
frankiej
,youcouldaccessthatuser’s
Documentsfolderas
~frankiej/Documents
(ifthatuserhassetpermissionsonhisorher
Documentsdirectorytoallowyoutoseeitscontents).
The
$HOME
environmentvariablecanalsobeusedtorepresentthecurrentuser’shome
directory.
InOSX,theuser’shomedirectoryusuallyresidesinthe
/Users
directoryoronanetwork
server.
~
or
$HOME
Fileanddirectorynamestraditionallyincludeonlyletters,numbers,hyphens,theunderscorecharacter(
_
),
andoftenaperiod(
.
)followedbyafileextensionthatindicatesthetypeoffile(
.txt
,forexample).Most
othercharacters,includingspacecharacters,shouldbeavoidedbecausetheyhavespecialmeaningtothe
shell.
AlthoughsomeOSXfilesystemspermittheuseoftheseothercharacters,includingspaces,youmustdoone
ofthefollowing:
“Escape”thecharacter—putabackslashcharacter(
\
)immediatelybeforethecharacterinthepath.
Addsingleordoublequotationmarksaroundthepathortheportionthatcontainstheoffendingcharacters.
Forexample,thepathname
My Disk
canbewrittenas
"My Disk"
,
'My Disk'
,or
My\ Disk
.
Singlequotesaresaferthandoublequotesbecausetheshelldoesnotdoanyinterpretationofthecontents
ofasingle-quotedstring.However,doublequotesarelesslikelytoappearinafilename,makingthemslightly
easiertouse.Whenindoubt,useabackslashbeforethecharacterinquestion,ortwobackslashestorepresent
aliteralbackslash.
CommandLinePrimer
BasicShellConcepts
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
257
Formoredetailedinformation,seeQuotingSpecialCharacters (page 66)inFlowControl,Expansion,and
Parsing (page 46).
AccessingFilesonAdditionalVolumes
OnatypicalUNIXsystem,thestorageprovidedbylocaldiskdrivesispresentedasasingletreeoffiles
descendingfromasinglerootdirectory.ThisdiffersfromthewaytheFinderpresentslocaldiskdrives,which
isasoneormorevolumes,witheachvolumeactingastherootofitsowndirectoryhierarchy.Tosatisfyboth
worlds,OSXincludesahiddendirectory,
Volumes
,attherootofthelocalfilesystem.Thisdirectorycontains
allofthevolumesattachedtothelocalcomputer.
Toaccessthecontentsofotherlocal(andmanynetwork)volumes,youprefixthevolume-relativepathwith
/Volumes/
followedbythevolumename.Forexample,toaccessthe
Applications
directoryonavolume
named
MacOSX
,youwouldusethepath
/Volumes/MacOSX/Applications
.
Note:  Toaccessfilesonthebootvolume,youarenotrequiredtoaddvolumeinformation,since
therootdirectoryofthebootvolumeis
/
.Includingthevolumeinformationstillworks,though,so
ifyouareinteractingwiththeshellfromanapplicationthatisvolume-aware,youmaywanttoadd
it,ifonlytobeconsistentwiththewayyouaccessothervolumes.Youmustincludethevolume
informationforallvolumesotherthanthebootvolume.
InputAndOutput
Mosttoolstaketextinputfromtheuserandprinttextouttotheuser’sscreen.Theydosousingthreestandard
filedescriptors,whicharecreatedbytheshellandareinheritedbytheprogramautomatically.Thesestandard
filedescriptorsarelistedinTableA-2.
TableA-2
Inputandoutputsourcesforprograms
Description
File
descriptor
Thestandardinputfiledescriptoristhemeansthroughwhichaprogramobtainsinput
fromtheuserorothertools.
Bydefault,thisdescriptorprovidestheuser’skeystrokes.Youcanalsoredirectthe
outputfromfilesorothercommandsto
stdin
,allowingyoutocontrolonetoolwith
anothertool.
stdin
Thestandardoutputfiledescriptoriswheremosttoolssendtheiroutputdata.
Bydefault,standardoutputsendsdatabacktotheuser.Youcanalsoredirectthisoutput
totheinputofothertools.
stdout
CommandLinePrimer
BasicShellConcepts
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
258
Description
File
descriptor
Thestandarderrorfiledescriptoriswheretheprogramsendserrormessages,debug
messages,andanyotherinformationthatshouldnotbeconsideredpartoftheprogram’s
actualoutputdata.
Bydefault,errorsaredisplayedonthecommandlinelikestandardoutput.Thepurpose
forhavingaseparateerrordescriptorissothattheusercanredirecttheactualoutput
datafromthetooltoanothertoolwithoutthatdatagettingcorruptedbynon-fatal
errorsandwarnings.
stderr
Tolearnmoreaboutworkingwiththesedescriptors,includingredirectingtheoutputofonetooltotheinput
ofanother,readShellInputandOutput (page 35).
TerminatingPrograms
Toterminatethecurrentlyrunningprogramfromthecommandline,pressControl-C.Thiskeyboardshortcut
sendsanabort(
ABRT
)signaltothecurrentlyrunningprocess.Inmostcasesthiscausestheprocesstoterminate,
althoughsometoolsmayinstallsignalhandlerstotrapthissignalandresponddifferently.(SeeTrapping
Signals (page 173)in AdvancedTechniques (page 168)fordetails.)
Inaddition,youcanterminatemostscriptsandcommand-linetoolsbyclosingaTerminalwindoworSSH
connection.Thissendsahangup(
HUP
)signaltotheshell,whichitthenpassesontothecurrentlyrunning
program.Ifyouwantaprogramtocontinuerunningafteryoulogout,youshouldrunitusingthe
nohup
command,whichcatchesthatsignalanddoesnotpassitontowhatevercommanditinvokes.
FrequentlyUsedCommands
Shellscriptinginvolvesamixtureofbuilt-inshellcommandsandstandardprogramsthatruninallshells.
Althoughmostshellsofferthesamebasicsetofcommands,thereareoftenvariationsinthesyntaxand
behaviorofthosecommands.Inadditiontotheshellcommands,OSXalsoprovidesasetofstandardprograms
thatruninallshells.
TableA-3listssomecommandsthatarecommonlyusedinteractivelyintheshell.Mostoftheitemsinthis
tablearenotspecifictoanygivenshell.Forsyntaxandusageinformationforeachcommand,seethe
correspondingmanpage.Foramorein-depthlistofcommandsandtheiraccompanyingdocumentation,see
OSXManPages.
CommandLinePrimer
FrequentlyUsedCommands
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
259
TableA-3
Frequentlyusedcommandsandprograms
Description
Meaning
Command
Printsthecontentsofthespecifiedfilesto
stdout
.
(con)catenate
cat
Changesthecurrentworkingdirectorytothespecifiedpath.
change
directory
cd
Copiesfiles(anddirectories,whenusingthe-roption)fromone
locationtoanother.
copy
cp
Displaysthecurrentdateandtimeusingthestandardformat.You
candisplaythisinformationinotherformatsbyinvokingthe
commandwithspecificflags.
date
date
Writesitsargumentsto
stdout
.Thiscommandismostoftenused
inshellscriptstoprintstatusinformationtotheuser.
echotooutput
echo
Usedtoscrollthroughthecontentsofafileortheresultsofanother
shellcommand.Thiscommandallowsforwardandbackward
navigationthroughthetext.
The
more
commandgotitsnamefromtheprompt“Pressakeyto
showmore....”commonlyusedattheendofascreenfulof
information.The
less
commandgetsitsnamefromtheidiom“less
ismore”.
pager
commands
less
and
more
Displaysthecontentsofthespecifieddirectory(orthecurrent
directoryifnopathisspecified).
Passthe
-a
flagtolistalldirectorycontents(includinghiddenfiles
anddirectories).
Passthe
-l
flagtodisplaydetailedinformationforeachentry.Pass
-@
with
-l
toshowextendedattributes.
List
ls
Createsanewdirectory.
MakeDirectory
mkdir
Movesfilesanddirectoriesfromoneplacetoanother.Youalsouse
thiscommandtorenamefilesanddirectories.
Move
mv
YoucanusethiscommandtolaunchapplicationsfromTerminal
andoptionallyopenfilesinthatapplication.
Openan
applicationor
file.
open
Displaysthefullpathofthecurrentdirectory.
PrintWorking
Directory
pwd
CommandLinePrimer
FrequentlyUsedCommands
2014-03-10   |   Copyright © 2003, 2014 Apple Inc. All Rights Reserved.
260
Documents you may be interested
Documents you may be interested