forked from swcarpentry/shell-novice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reference.html
710 lines (668 loc) · 38.5 KB
/
reference.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
<!DOCTYPE html>
<!-- START: inst/pkgdown/templates/layout.html --><!-- Generated by pkgdown: do not edit by hand --><html lang="en" data-bs-theme="auto"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="utf-8"><title>The Unix Shell: Summary of Basic Commands</title><meta name="viewport" content="width=device-width, initial-scale=1"><script src="assets/themetoggle.js"></script><link rel="stylesheet" type="text/css" href="assets/styles.css"><script src="assets/scripts.js" type="text/javascript"></script><!-- mathjax --><script type="text/x-mathjax-config">
MathJax.Hub.Config({
config: ["MMLorHTML.js"],
jax: ["input/TeX","input/MathML","output/HTML-CSS","output/NativeMML", "output/PreviewHTML"],
extensions: ["tex2jax.js","mml2jax.js","MathMenu.js","MathZoom.js", "fast-preview.js", "AssistiveMML.js", "a11y/accessibility-menu.js"],
TeX: {
extensions: ["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]
},
tex2jax: {
inlineMath: [['\\(', '\\)']],
displayMath: [ ['$$','$$'], ['\\[', '\\]'] ],
processEscapes: true
}
});
</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><!-- Responsive Favicon for The Carpentries --><link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png"><link rel="manifest" href="site.webmanifest"><link rel="mask-icon" href="safari-pinned-tab.svg" color="#5bbad5"><meta name="msapplication-TileColor" content="#da532c"><meta name="theme-color" media="(prefers-color-scheme: light)" content="white"><meta name="theme-color" media="(prefers-color-scheme: dark)" content="black"></head><body>
<header id="top" class="navbar navbar-expand-md top-nav software"><svg xmlns="http://www.w3.org/2000/svg" class="d-none"><symbol id="check2" viewbox="0 0 16 16"><path d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"></path></symbol><symbol id="circle-half" viewbox="0 0 16 16"><path d="M8 15A7 7 0 1 0 8 1v14zm0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16z"></path></symbol><symbol id="moon-stars-fill" viewbox="0 0 16 16"><path d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z"></path><path d="M10.794 3.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387a1.734 1.734 0 0 0-1.097 1.097l-.387 1.162a.217.217 0 0 1-.412 0l-.387-1.162A1.734 1.734 0 0 0 9.31 6.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387a1.734 1.734 0 0 0 1.097-1.097l.387-1.162zM13.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732l-.774-.258a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L13.863.1z"></path></symbol><symbol id="sun-fill" viewbox="0 0 16 16"><path d="M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"></path></symbol></svg><a class="visually-hidden-focusable skip-link" href="#main-content">Skip to main content</a>
<div class="container-fluid top-nav-container">
<div class="col-md-8">
<div class="large-logo">
<img id="swc-logo" alt="Software Carpentry" src="assets/images/software-logo.svg"></div>
</div>
<div class="selector-container">
<div id="theme-selector">
<li class="nav-item dropdown" id="theme-button-list">
<button class="btn btn-link nav-link px-0 px-lg-2 dropdown-toggle d-flex align-items-center" id="bd-theme" type="button" aria-expanded="false" data-bs-toggle="dropdown" data-bs-display="static" aria-label="Toggle theme (auto)">
<svg class="bi my-1 theme-icon-active"><use href="#circle-half"></use></svg><i data-feather="chevron-down"></i>
</button>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="bd-theme-text"><li>
<button type="button" class="btn dropdown-item d-flex align-items-center" data-bs-theme-value="light" aria-pressed="false">
<svg class="bi me-2 theme-icon"><use href="#sun-fill"></use></svg>
Light
<svg class="bi ms-auto d-none"><use href="#check2"></use></svg></button>
</li>
<li>
<button type="button" class="btn dropdown-item d-flex align-items-center" data-bs-theme-value="dark" aria-pressed="false">
<svg class="bi me-2 theme-icon"><use href="#moon-stars-fill"></use></svg>
Dark
<svg class="bi ms-auto d-none"><use href="#check2"></use></svg></button>
</li>
<li>
<button type="button" class="btn dropdown-item d-flex align-items-center active" data-bs-theme-value="auto" aria-pressed="true">
<svg class="bi me-2 theme-icon"><use href="#circle-half"></use></svg>
Auto
<svg class="bi ms-auto d-none"><use href="#check2"></use></svg></button>
</li>
</ul></li>
</div>
<div class="dropdown" id="instructor-dropdown">
<button class="btn btn-secondary dropdown-toggle bordered-button" type="button" id="dropdownMenu1" data-bs-toggle="dropdown" aria-expanded="false">
<i aria-hidden="true" class="icon" data-feather="eye"></i> Learner View <i data-feather="chevron-down"></i>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1"><li><button class="dropdown-item" type="button" onclick="window.location.href='instructor/reference.html';">Instructor View</button></li>
</ul></div>
</div>
</div>
<hr></header><nav class="navbar navbar-expand-xl bottom-nav software" aria-label="Main Navigation"><div class="container-fluid nav-container">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle Navigation">
<span class="navbar-toggler-icon"></span>
<span class="menu-title">Menu</span>
</button>
<div class="nav-logo">
<img class="small-logo" alt="Software Carpentry" src="assets/images/software-logo-sm.svg"></div>
<div class="lesson-title-md">
The Unix Shell
</div>
<div class="search-icon-sm">
<!-- TODO: do not show until we have search
<i role="img" aria-label="Search the All In One page" data-feather="search"></i>
-->
</div>
<div class="desktop-nav">
<ul class="navbar-nav me-auto mb-2 mb-lg-0"><li class="nav-item">
<span class="lesson-title">
The Unix Shell
</span>
</li>
<li class="nav-item">
<a class="nav-link" href="key-points.html">Key Points</a>
</li>
<li class="nav-item">
<a class="nav-link" href="reference.html#glossary">Glossary</a>
</li>
<li class="nav-item">
<a class="nav-link" href="profiles.html">Learner Profiles</a>
</li>
<li class="nav-item dropdown">
<button class="nav-link dropdown-toggle" id="navbarDropdown" data-bs-toggle="dropdown" aria-expanded="false">
More <i data-feather="chevron-down"></i>
</button>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown"><li><a class="dropdown-item" href="discuss.html">Discussion</a></li><li><a class="dropdown-item" href="reference.html">Summary of Basic Commands</a></li>
</ul></li>
</ul></div>
<!--
<form class="d-flex col-md-2 search-form">
<fieldset disabled>
<input class="form-control me-2 searchbox" type="search" placeholder="" aria-label="">
<button class="btn btn-outline-success tablet-search-button" type="submit">
<i class="search-icon" data-feather="search" role="img" aria-label="Search the All In One page"></i>
</button>
</fieldset>
</form>
-->
<a id="search-button" class="btn btn-primary" href="aio.html" role="button" aria-label="Search the All In One page">Search the All In One page</a>
</div><!--/div.container-fluid -->
</nav><div class="col-md-12 mobile-title">
The Unix Shell
</div>
<aside class="col-md-12 lesson-progress"><div style="width: NA%" class="percentage">
NA%
</div>
<div class="progress software">
<div class="progress-bar software" role="progressbar" style="width: NA%" aria-valuenow="NA" aria-label="Lesson Progress" aria-valuemin="0" aria-valuemax="100">
</div>
</div>
</aside><div class="container">
<div class="row">
<!-- START: inst/pkgdown/templates/navbar.html -->
<div id="sidebar-col" class="col-lg-4">
<div id="sidebar" class="sidebar">
<nav aria-labelledby="flush-headingEleven"><button role="button" aria-label="close menu" alt="close menu" aria-expanded="true" aria-controls="sidebar" class="collapse-toggle" data-collapse="Collapse " data-episodes="Episodes ">
<i class="search-icon" data-feather="x" role="img"></i>
</button>
<div class="sidebar-inner">
<div class="row mobile-row" id="theme-row-mobile">
<div class="col" id="theme-selector">
<li class="nav-item dropdown" id="theme-button-list">
<button class="btn btn-link nav-link px-0 px-lg-2 dropdown-toggle d-flex align-items-center" id="bd-theme" type="button" aria-expanded="false" data-bs-toggle="dropdown" data-bs-display="static" aria-label="Toggle theme (auto)">
<svg class="bi my-1 theme-icon-active"><use href="#circle-half"></use></svg><span class="d-lg-none ms-1" id="bd-theme-text">Toggle Theme</span>
</button>
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="bd-theme-text"><li>
<button type="button" class="btn dropdown-item d-flex align-items-center" data-bs-theme-value="light" aria-pressed="false">
<svg class="bi me-2 theme-icon"><use href="#sun-fill"></use></svg>
Light
<svg class="bi ms-auto d-none"><use href="#check2"></use></svg></button>
</li>
<li>
<button type="button" class="btn dropdown-item d-flex align-items-center" data-bs-theme-value="dark" aria-pressed="false">
<svg class="bi me-2 theme-icon"><use href="#moon-stars-fill"></use></svg>
Dark
<svg class="bi ms-auto d-none"><use href="#check2"></use></svg></button>
</li>
<li>
<button type="button" class="btn dropdown-item d-flex align-items-center active" data-bs-theme-value="auto" aria-pressed="true">
<svg class="bi me-2 theme-icon"><use href="#circle-half"></use></svg>
Auto
<svg class="bi ms-auto d-none"><use href="#check2"></use></svg></button>
</li>
</ul></li>
</div>
</div>
<div class="row mobile-row">
<div class="col">
<div class="sidenav-view-selector">
<div class="accordion accordion-flush" id="accordionFlush9">
<div class="accordion-item">
<h2 class="accordion-header" id="flush-headingNine">
<button class="accordion-button collapsed" id="instructor" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseNine" aria-expanded="false" aria-controls="flush-collapseNine">
<i id="eye" aria-hidden="true" class="icon" data-feather="eye"></i> Learner View
</button>
</h2>
<div id="flush-collapseNine" class="accordion-collapse collapse" aria-labelledby="flush-headingNine" data-bs-parent="#accordionFlush2">
<div class="accordion-body">
<a href="instructor/reference.html">Instructor View</a>
</div>
</div>
</div><!--/div.accordion-item-->
</div><!--/div.accordion-flush-->
</div><!--div.sidenav-view-selector -->
</div><!--/div.col -->
<hr></div><!--/div.mobile-row -->
<div class="accordion accordion-flush" id="accordionFlush11">
<div class="accordion-item">
<button id="chapters" class="accordion-button show" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseEleven" aria-expanded="false" aria-controls="flush-collapseEleven">
<h2 class="accordion-header chapters" id="flush-headingEleven">
EPISODES
</h2>
</button>
<div id="flush-collapseEleven" class="accordion-collapse show collapse" aria-labelledby="flush-headingEleven" data-bs-parent="#accordionFlush11">
<div class="accordion-body">
<div class="accordion accordion-flush" id="accordionFlush1">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading1">
<a href="index.html">Summary and Setup</a>
</div><!--/div.accordion-header-->
</div><!--/div.accordion-item-->
</div><!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlush2">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading2">
<a href="01-intro.html">1. Introducing the Shell</a>
</div><!--/div.accordion-header-->
</div><!--/div.accordion-item-->
</div><!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlush3">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading3">
<a href="02-filedir.html">2. Navigating Files and Directories</a>
</div><!--/div.accordion-header-->
</div><!--/div.accordion-item-->
</div><!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlush4">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading4">
<a href="03-create.html">3. Working With Files and Directories</a>
</div><!--/div.accordion-header-->
</div><!--/div.accordion-item-->
</div><!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlush5">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading5">
<a href="04-pipefilter.html">4. Pipes and Filters</a>
</div><!--/div.accordion-header-->
</div><!--/div.accordion-item-->
</div><!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlush6">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading6">
<a href="05-loop.html">5. Loops</a>
</div><!--/div.accordion-header-->
</div><!--/div.accordion-item-->
</div><!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlush7">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading7">
<a href="06-script.html">6. Shell Scripts</a>
</div><!--/div.accordion-header-->
</div><!--/div.accordion-item-->
</div><!--/div.accordion-flush-->
<div class="accordion accordion-flush" id="accordionFlush8">
<div class="accordion-item">
<div class="accordion-header" id="flush-heading8">
<a href="07-find.html">7. Finding Things</a>
</div><!--/div.accordion-header-->
</div><!--/div.accordion-item-->
</div><!--/div.accordion-flush-->
</div>
</div>
</div>
<hr class="half-width"><div class="accordion accordion-flush lesson-resources" id="accordionFlush12">
<div class="accordion-item">
<h2 class="accordion-header" id="flush-headingTwelve">
<button class="accordion-button collapsed" id="lesson-resources" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseTwelve" aria-expanded="false" aria-controls="flush-collapseTwelve">
RESOURCES
</button>
</h2>
<div id="flush-collapseTwelve" class="accordion-collapse collapse" aria-labelledby="flush-headingTwelve" data-bs-parent="#accordionFlush12">
<div class="accordion-body">
<ul><li>
<a href="key-points.html">Key Points</a>
</li>
<li>
<a href="reference.html#glossary">Glossary</a>
</li>
<li>
<a href="profiles.html">Learner Profiles</a>
</li>
<li><a href="discuss.html">Discussion</a></li><li><a href="reference.html">Summary of Basic Commands</a></li>
</ul></div>
</div>
</div>
</div>
<hr class="half-width lesson-resources"><a href="aio.html">See all in one page</a>
<hr class="d-none d-sm-block d-md-none"><div class="d-grid gap-1">
</div>
</div><!-- /div.accordion -->
</div><!-- /div.sidebar-inner -->
</nav></div><!-- /div.sidebar -->
</div><!-- /div.sidebar-col -->
<!-- END: inst/pkgdown/templates/navbar.html-->
<!-- START: inst/pkgdown/templates/content-instructor.html -->
<div class="col-xl-8 col-lg-12 primary-content">
<nav class="lesson-content mx-md-4" aria-label="Previous and Next Chapter"><!-- content for small screens --><div class="d-block d-sm-block d-md-none">
<a class="chapter-link" href="index.html"><i aria-hidden="true" class="small-arrow" data-feather="arrow-left"></i>Previous</a>
<a class="chapter-link float-end" href="index.html">Next<i aria-hidden="true" class="small-arrow" data-feather="arrow-right"></i></a>
</div>
<!-- content for large screens -->
<div class="d-none d-sm-none d-md-block">
<a class="chapter-link" href="index.html" rel="prev">
<i aria-hidden="true" class="small-arrow" data-feather="arrow-left"></i>
Home
</a>
<a class="chapter-link float-end" href="index.html" rel="next">
Home
<i aria-hidden="true" class="small-arrow" data-feather="arrow-right"></i>
</a>
</div>
<hr></nav><main id="main-content" class="main-content"><div class="container lesson-content">
<h1>Summary of Basic Commands</h1>
<p>Last updated on 2023-07-23 |
<a href="https://github.com/swcarpentry/shell-novice/edit/main/learners/reference.md" class="external-link">Edit this page <i aria-hidden="true" data-feather="edit"></i></a></p>
<div class="text-end">
<button role="button" aria-pressed="false" tabindex="0" id="expand-code" class="pull-right" data-expand="Expand All Solutions " data-collapse="Collapse All Solutions "> Expand All Solutions <i aria-hidden="true" data-feather="plus"></i></button>
</div>
<section><h2 class="section-heading" id="summary-of-basic-commands">Summary of Basic Commands<a class="anchor" aria-label="anchor" href="#summary-of-basic-commands"></a></h2>
<hr class="half-width"><table class="table"><thead><tr class="header"><th>Action</th>
<th>Files</th>
<th>Folders</th>
</tr></thead><tbody><tr class="odd"><td>Inspect</td>
<td>ls</td>
<td>ls</td>
</tr><tr class="even"><td>View content</td>
<td>cat</td>
<td>ls</td>
</tr><tr class="odd"><td>Navigate to</td>
<td></td>
<td>cd</td>
</tr><tr class="even"><td>Move</td>
<td>mv</td>
<td>mv</td>
</tr><tr class="odd"><td>Copy</td>
<td>cp</td>
<td>cp -r</td>
</tr><tr class="even"><td>Create</td>
<td>nano</td>
<td>mkdir</td>
</tr><tr class="odd"><td>Delete</td>
<td>rm</td>
<td>rmdir, rm -r</td>
</tr></tbody></table></section><section><h2 class="section-heading" id="filesystem-hierarchy">Filesystem hierarchy<a class="anchor" aria-label="anchor" href="#filesystem-hierarchy"></a></h2>
<hr class="half-width"><p>The following is an overview of a standard Unix filesystem. The exact
hierarchy depends on the platform. Your file/directory structure may
differ slightly:</p>
<figure><img src="fig/standard-filesystem-hierarchy.svg" alt="Linux filesystem hierarchy" class="figure mx-auto d-block"></figure></section><section><h2 class="section-heading" id="glossary">Glossary<a class="anchor" aria-label="anchor" href="#glossary"></a></h2>
<hr class="half-width"><dl><dt><span id="absolute-path">absolute path</span></dt>
<dd>
A <a href="#path">path</a> that refers to a particular location in a
file system. Absolute paths are usually written with respect to the file
system’s <a href="#root-directory">root directory</a>, and begin with
either “/” (on Unix) or “\” (on Microsoft Windows). See also: <a href="#relative-path">relative path</a>.
</dd>
<dt><span id="argument">argument</span></dt>
<dd>
A value given to a function or program when it runs. The term is often
used interchangeably (and inconsistently) with <a href="#parameter">parameter</a>.
</dd>
<dt><span id="command-shell">command shell</span></dt>
<dd>
See <a href="#shell">shell</a>
</dd>
<dt><span id="command-line-interface">command-line interface</span></dt>
<dd>
A user interface based on typing commands, usually at a <a href="#read-evaluate-print-loop">REPL</a>. See also: <a href="#graphical-user-interface">graphical user interface</a>.
</dd>
<dt><span id="comment">comment</span></dt>
<dd>
A remark in a program that is intended to help human readers understand
what is going on, but is ignored by the computer. Comments in Python, R,
and the Unix shell start with a <code>#</code> character and run to the
end of the line; comments in SQL start with <code>--</code>, and other
languages have other conventions.
</dd>
<dt><span id="current-working-directory">current working
directory</span></dt>
<dd>
The directory that <a href="#relative-path">relative paths</a> are
calculated from; equivalently, the place where files referenced by name
only are searched for. Every <a href="#process">process</a> has a
current working directory. The current working directory is usually
referred to using the shorthand notation <code>.</code> (pronounced
“dot”).
</dd>
<dt><span id="file-system">file system</span></dt>
<dd>
A set of files, directories, and I/O devices (such as keyboards and
screens). A file system may be spread across many physical devices, or
many file systems may be stored on a single physical device; the <a href="#operating-system">operating system</a> manages access.
</dd>
<dt><span id="filename-extension">filename extension</span></dt>
<dd>
The portion of a file’s name that comes after the final “.” character.
By convention this identifies the file’s type: <code>.txt</code> means
“text file”, <code>.png</code> means “Portable Network Graphics file”,
and so on. These conventions are not enforced by most operating systems:
it is perfectly possible (but confusing!) to name an MP3 sound file
<code>homepage.html</code>. Since many applications use filename
extensions to identify the <a href="#mime-type">MIME type</a> of the
file, misnaming files may cause those applications to fail.
</dd>
<dt><span id="filter">filter</span></dt>
<dd>
A program that transforms a stream of data. Many Unix command-line tools
are written as filters: they read data from <a href="#standard-input">standard input</a>, process it, and write the
result to <a href="#standard-output">standard output</a>.
</dd>
<dt><span id="for-loop">for loop</span></dt>
<dd>
A loop that is executed once for each value in some kind of set, list,
or range. See also: <a href="#while-loop">while loop</a>.
</dd>
<dt><span id="graphical-user-interface">graphical user
interface</span></dt>
<dd>
A user interface based on selecting items and actions from a graphical
display, usually controlled by using a mouse. See also: <a href="#command-line-interface">command-line interface</a>.
</dd>
<dt><span id="home-directory">home directory</span></dt>
<dd>
The default directory associated with an account on a computer system.
By convention, all of a user’s files are stored in or below her home
directory.
</dd>
<dt><span id="loop">loop</span></dt>
<dd>
A set of instructions to be executed multiple times. Consists of a <a href="#loop-body">loop body</a> and (usually) a condition for exiting
the loop. See also <a href="#for-loop">for loop</a> and <a href="#while-loop">while loop</a>.
</dd>
<dt><span id="loop-body">loop body</span></dt>
<dd>
The set of statements or commands that are repeated inside a <a href="#for-loop">for loop</a> or <a href="#while-loop">while loop</a>.
</dd>
<dt><span id="mime-type">MIME type</span></dt>
<dd>
MIME (Multi-Purpose Internet Mail Extensions) types describe different
file types for exchange on the Internet, for example, images, audio, and
documents.
</dd>
<dt><span id="operating-system">operating system</span></dt>
<dd>
Software that manages interactions between users, hardware, and software
<a href="#process">processes</a>. Common examples are Linux, macOS, and
Windows.
</dd>
<dt><span id="option">option</span></dt>
<dd>
A way to specify an argument or setting to a command-line program. By
convention Unix applications use a dash followed by a single letter,
such as <code>-v</code>, or two dashes followed by a word, such as
<code>--verbose</code>, while DOS applications use a slash, such as
<code>/V</code>. Depending on the application, an option may be followed
by a single argument, as in <code>-o /tmp/output.txt</code>.
</dd>
<dt><span id="parameter">parameter</span></dt>
<dd>
A variable named in a function’s declaration that is used to hold a
value passed into the call. The term is often used interchangeably (and
inconsistently) with <a href="#argument">argument</a>.
</dd>
<dt><span id="parent-directory">parent directory</span></dt>
<dd>
The directory that “contains” the one in question. Every directory in a
file system except the <a href="#root-directory">root directory</a> has
a parent. A directory’s parent is usually referred to using the
shorthand notation <code>..</code> (pronounced “dot dot”).
</dd>
<dt><span id="path">path</span></dt>
<dd>
A description that specifies the location of a file or directory within
a <a href="#file-system">file system</a>. See also: <a href="#absolute-path">absolute path</a>, <a href="#relative-path">relative path</a>.
</dd>
<dt><span id="pipe">pipe</span></dt>
<dd>
A connection from the output of one program to the input of another.
When two or more programs are connected in this way, they are called a
“pipeline”.
</dd>
<dt><span id="process">process</span></dt>
<dd>
A running instance of a program, containing code, variable values, open
files and network connections, and so on. Processes are the “actors”
that the <a href="#operating-system">operating system</a> manages; it
typically runs each process for a few milliseconds at a time to give the
impression that they are executing simultaneously.
</dd>
<dt><span id="prompt">prompt</span></dt>
<dd>
A character or characters display by a <a href="#read-evaluate-print-loop">REPL</a> to show that it is waiting for
its next command.
</dd>
<dt><span id="quoting">quoting</span></dt>
<dd>
(in the shell): Using quotation marks of various kinds to prevent the
shell from interpreting special characters. For example, to pass the
string <code>*.txt</code> to a program, it is usually necessary to write
it as <code>'*.txt'</code> (with single quotes) so that the shell will
not try to expand the <code>*</code> wildcard.
</dd>
<dt><span id="read-evaluate-print-loop">read-evaluate-print
loop</span></dt>
<dd>
(REPL): A <a href="#command-line-interface">command-line interface</a>
that reads a command from the user, executes it, prints the result, and
waits for another command.
</dd>
<dt><span id="redirect">redirect</span></dt>
<dd>
To send a command’s output to a file rather than to the screen or
another command, or equivalently to read a command’s input from a file.
</dd>
<dt><span id="regular-expression">regular expression</span></dt>
<dd>
A pattern that specifies a set of character strings. REs are most often
used to find sequences of characters in strings.
</dd>
<dt><span id="relative-path">relative path</span></dt>
<dd>
A <a href="#path">path</a> that specifies the location of a file or
directory with respect to the <a href="#current-working-directory">current working directory</a>. Any
path that does not begin with a separator character (“/” or “\”) is a
relative path. See also: <a href="#absolute-path">absolute path</a>.
</dd>
<dt><span id="root-directory">root directory</span></dt>
<dd>
The top-most directory in a <a href="#file-system">file system</a>. Its
name is “/” on Unix (including Linux and macOS) and “\” on Microsoft
Windows.
</dd>
<dt><span id="shell">shell</span></dt>
<dd>
A <a href="#command-line-interface">command-line interface</a> such as
Bash (the Bourne-Again Shell) or the Microsoft Windows DOS shell that
allows a user to interact with the <a href="#operating-system">operating
system</a>.
</dd>
<dt><span id="shell-script">shell script</span></dt>
<dd>
A set of <a href="#shell">shell</a> commands stored in a file for
re-use. A shell script is a program executed by the shell; the name
“script” is used for historical reasons.
</dd>
<dt><span id="standard-input">standard input</span></dt>
<dd>
A process’s default input stream. In interactive command-line
applications, it is typically connected to the keyboard; in a <a href="#pipe">pipe</a>, it receives data from the <a href="#standard-output">standard output</a> of the preceding process.
</dd>
<dt><span id="standard-output">standard output</span></dt>
<dd>
A process’s default output stream. In interactive command-line
applications, data sent to standard output is displayed on the screen;
in a <a href="#pipe">pipe</a>, it is passed to the <a href="#standard-input">standard input</a> of the next process.
</dd>
<dt><span id="sub-directory">sub-directory</span></dt>
<dd>
A directory contained within another directory.
</dd>
<dt><span id="tab-completion">tab completion</span></dt>
<dd>
A feature provided by many interactive systems in which pressing the Tab
key triggers automatic completion of the current word or command.
</dd>
<dt><span id="variable">variable</span></dt>
<dd>
A name in a program that is associated with a value or a collection of
values.
</dd>
<dt><span id="while-loop">while loop</span></dt>
<dd>
A loop that keeps executing as long as some condition is true. See also:
<a href="#for-loop">for loop</a>.
</dd>
<dt><span id="wildcard">wildcard</span></dt>
<dd>
A character used in pattern matching. In the Unix shell, the wildcard
<code>*</code> matches zero or more characters, so that
<code>*.txt</code> matches all files whose names end in
<code>.txt</code>.
</dd>
</dl></section><section><h2 class="section-heading" id="external-references">External references<a class="anchor" aria-label="anchor" href="#external-references"></a></h2>
<hr class="half-width"><div class="section level3">
<h3 id="opening-a-terminal">Opening a terminal<a class="anchor" aria-label="anchor" href="#opening-a-terminal"></a></h3>
<ul><li><a href="https://www.macworld.co.uk/feature/mac-software/how-use-terminal-on-mac-3608274/" class="external-link">How
to Use Terminal on a Mac</a></li>
<li><a href="https://git-for-windows.github.io/" class="external-link">Git for
Windows</a></li>
<li><a href="https://www.windowscentral.com/how-install-bash-shell-command-line-windows-10" class="external-link">How
to Install Bash shell command-line tool on Windows 10</a></li>
<li><a href="https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/" class="external-link">Install
and Use the Linux Bash Shell on Windows 10</a></li>
<li><a href="https://www.howtogeek.com/265900/everything-you-can-do-with-windows-10s-new-bash-shell/" class="external-link">Using
the Windows 10 Bash Shell</a></li>
<li><a href="https://faculty.smu.edu/reynolds/unixtut/windows.html" class="external-link">Using a
UNIX/Linux emulator (Cygwin) or Secure Shell (SSH) client
(Putty)</a></li>
</ul></div>
<div class="section level3">
<h3 id="manuals">Manuals<a class="anchor" aria-label="anchor" href="#manuals"></a></h3>
<ul><li><a href="https://www.gnu.org/manual/manual.html" class="external-link">GNU
manuals</a></li>
<li><a href="https://www.gnu.org/software/coreutils/manual/coreutils.html" class="external-link">Core
GNU utilities</a></li>
</ul></div>
<div class="section level3">
<h3 id="miscellaneous">Miscellaneous<a class="anchor" aria-label="anchor" href="#miscellaneous"></a></h3>
<ul><li><a href="https://en.wikipedia.org/wiki/North_Pacific_Gyre" class="external-link">North
Pacific Gyre</a></li>
<li><a href="https://en.wikipedia.org/wiki/Great_Pacific_Garbage_Patch" class="external-link">Great
Pacific Garbage Patch</a></li>
<li><a href="https://www.clir.org/pubs/archives/ensuring.pdf" class="external-link">‘Ensuring
the longevity of digital information’ by Jeff Rothenberg</a></li>
<li><a href="https://wiki.c2.com/?ComputerErrorHaiku" class="external-link">Computer error
haikus</a></li>
<li><a href="https://speakerdeck.com/jennybc/how-to-name-files" class="external-link">How to
name files nicely, by Jenny Bryan</a></li>
</ul></div>
</section></div> <!-- / div.lesson-content -->
</main><!-- / main#main-content.main-content --><nav class="bottom-pagination mx-md-4" aria-label="Previous and Next Chapter"><div class="d-block d-sm-block d-md-none">
<a class="chapter-link" href="index.html"><i aria-hidden="true" class="small-arrow" data-feather="arrow-left"></i>Previous</a>
<a class="chapter-link float-end" href="index.html">Next<i aria-hidden="true" class="small-arrow" data-feather="arrow-right"></i></a>
</div>
<!-- content for large screens -->
<div class="d-none d-sm-none d-md-block">
<a class="chapter-link" href="index.html" rel="prev">
<i aria-hidden="true" class="small-arrow" data-feather="arrow-left"></i>
Home
</a>
<a class="chapter-link float-end" href="index.html" rel="next">
Home
<i aria-hidden="true" class="small-arrow" data-feather="arrow-right"></i>
</a>
</div>
</nav></div> <!-- / div.primary-content.col-xs-12 -->
<!-- END: inst/pkgdown/templates/content-instructor.html-->
</div><!--/div.row-->
<footer class="row footer mx-md-3"><hr><div class="col-md-6">
<p>This lesson is subject to the <a href="CODE_OF_CONDUCT.html">Code of Conduct</a></p>
<p>
<a href="https://github.com/swcarpentry/shell-novice/edit/main/learners/reference.md" class="external-link">Edit on GitHub</a>
| <a href="https://github.com/swcarpentry/shell-novice/blob/main/CONTRIBUTING.md" class="external-link">Contributing</a>
| <a href="https://github.com/swcarpentry/shell-novice/" class="external-link">Source</a></p>
<p><a href="https://github.com/swcarpentry/shell-novice/blob/main/CITATION" class="external-link">Cite</a> | <a href="mailto:[email protected]">Contact</a> | <a href="https://carpentries.org/about/" class="external-link">About</a></p>
</div>
<div class="col-md-6">
<p>Materials licensed under <a href="LICENSE.html">CC-BY 4.0</a> by the authors</p>
<p>Template licensed under <a href="https://creativecommons.org/licenses/by-sa/4.0/" class="external-link">CC-BY 4.0</a> by <a href="https://carpentries.org/" class="external-link">The Carpentries</a></p>
<p>Built with <a href="https://github.com/carpentries/sandpaper/tree/0.16.7" class="external-link">sandpaper (0.16.7)</a>, <a href="https://github.com/carpentries/pegboard/tree/0.7.6" class="external-link">pegboard (0.7.6)</a>, and <a href="https://github.com/carpentries/varnish/tree/1.0.4" class="external-link">varnish (1.0.4)</a></p>
</div>
</footer></div> <!-- / div.container -->
<div id="to-top">
<a href="#top">
<i class="search-icon" data-feather="arrow-up" role="img" aria-label="Back To Top"></i><br><!-- <span class="d-none d-sm-none d-md-none d-lg-none d-xl-block">Back</span> To Top --><span class="d-none d-sm-none d-md-none d-lg-none d-xl-block">Back</span> To Top
</a>
</div>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "TrainingMaterial",
"@id": "https://swcarpentry.github.io/shell-novice/reference.html",
"inLanguage": "en",
"dct:conformsTo": "https://bioschemas.org/profiles/TrainingMaterial/1.0-RELEASE",
"description": "A Carpentries Lesson teaching foundational data and coding skills to researchers worldwide",
"keywords": "software, data, lesson, The Carpentries",
"name": "Summary of Basic Commands",
"creativeWorkStatus": "active",
"url": "https://swcarpentry.github.io/shell-novice/reference.html",
"identifier": "https://swcarpentry.github.io/shell-novice/reference.html",
"dateCreated": "2014-10-22",
"dateModified": "2023-07-23",
"datePublished": "2024-09-10"
}
</script><script>
feather.replace();
</script><!-- Matomo --><script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
_paq.push(["setDomains", ["*.lessons.carpentries.org","*.datacarpentry.github.io","*.datacarpentry.org","*.librarycarpentry.github.io","*.librarycarpentry.org","*.swcarpentry.github.io", "*.carpentries.github.io"]]);
_paq.push(["setDoNotTrack", true]);
_paq.push(["disableCookies"]);
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function() {
var u="https://matomo.carpentries.org/";
_paq.push(["setTrackerUrl", u+"matomo.php"]);
_paq.push(["setSiteId", "1"]);
var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0];
g.async=true; g.src="https://matomo.carpentries.org/matomo.js"; s.parentNode.insertBefore(g,s);
})();
</script><!-- End Matomo Code --></body></html><!-- END: inst/pkgdown/templates/layout.html-->