-
Notifications
You must be signed in to change notification settings - Fork 30
Complete terminal basics section #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
angihe93
wants to merge
1
commit into
fractal-nyc:main
Choose a base branch
from
angihe93:angi/terminal-basics
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| # TERMINAL | ||
|
|
||
| ## QUESTIONS | ||
|
|
||
| ### What are the top 20 commands for mac Command Line Interface (CLI)? | ||
| 1. cd | ||
| - change to a different working directory | ||
| - usage: cd “path/to/directory/” | ||
|
|
||
| 2. ls | ||
| - list contents of directory, can add arguments like -l to get more information about files | ||
| - usage: ls "path/to/directory/" | ||
|
|
||
| 3. open | ||
| - open a file with an appropriate app, can partially type filename and press tab to autocomplete | ||
| - usage: open "filename" | ||
|
|
||
| 4. cp | ||
| - copy file to another directory | ||
| - usage: cp "filenamepath" "newfilenamepath" | ||
|
|
||
| 5. mv | ||
| - move file to a new location | ||
| - usage: mv "filenamepath" "newfilenamepath" | ||
|
|
||
| 6. touch | ||
| - create a blank file of any type, can use open command afterwards | ||
| - usage: touch myfile.txt | ||
|
|
||
| 7. mkdir | ||
| - create a directory | ||
| - usage: mkdir "path/to/new/directory" | ||
|
|
||
| 8. rmdir | ||
| - remove a directory | ||
| - usage: rmdir "path/to/directory" | ||
|
|
||
| 9. rm -R | ||
| - remove nested directories and contents recursively, note this is irreversible and cannot restore files afterwards from Trash | ||
| - usage: rm -R “/path/to/directory" | ||
|
|
||
| 10. sudo | ||
| - execute commands with superuser privileges, use for example removing a file owned by another user | ||
| - usage: sudo "command" | ||
|
|
||
| 11. top | ||
| - list actively running processes, see stats like memory, CPU, disk utilization, ports used, will execute until ctrl-C or close terminal window | ||
| - usage: top | ||
|
|
||
| 12. q | ||
| - quit subscreen for commands that run perpetually like top, alternative to ctrl-C | ||
| - usage: q | ||
|
|
||
| 13. clear | ||
| - clear terminal screen of all previous commands | ||
| - usage: clear, or cmd-K | ||
|
|
||
| 14. ditto | ||
| - copy contents of one folder to another folder, can use -V to gget verbose output for each file copied | ||
| - usage: ditto -V folder newfolder | ||
|
|
||
| 15. whatis | ||
| - get one-line description for a command | ||
| - usage: whatis "command" | ||
|
|
||
| 16. man | ||
| - show manual page for a command | ||
| - usage: man "command" | ||
|
|
||
| 17. exit | ||
| - close out current session in terminal, can use when closing out window is not available eg. when using ssh to close remote connection | ||
| - usage: exit | ||
|
|
||
| 18. shortcuts run | ||
| - run Apple shortcut workflow | ||
| - usage: shortcuts run "myshortcut" | ||
|
|
||
| 19. tmutil startbackup | ||
| - start a new Time Machine backup snapshot | ||
| - usage: tmutil startbackup | ||
|
|
||
| 20. killall | ||
| - force quit an app | ||
| - usage: killall "appname" | ||
|
|
||
| (https://www.techrepublic.com/article/16-terminal-commands-every-user-should-know/) | ||
|
|
||
| ### What is a terminal? A CLI? Why are they synonymous? | ||
| - Terminal is originally referred to a physical device (like a keyboard and monitor) used to interact with a computer. Today it usually refers to terminal emulators or software like the mac terminal app. | ||
| - CLI is a way of interacting with software by typing text commands, as opposed to using a GUI. | ||
| - A CLI can run inside a terminal but isn't the terminal itself, but in casual conversations people interchange the terms | ||
|
|
||
| (chatGPT) | ||
|
|
||
| ### What is the difference between bash and zsh? | ||
|
|
||
| These are different Linux shell environments. | ||
| - Bash was created by the GNU project to be part of its free operating system, named after "Bourne Again shell". First released in 1989, it is the default shell on most Linux distributions and on Apple's macOS. | ||
| - Z shell, or "zsh" is a popular newer shell, a Bourne-style shell that contains the features in bash, plus even more. For example, zsh has spell-checking, the ability to watch for logins/logouts, some built-in programming features like bytecode, support for scientific notation in syntax, allows for floating-point arithmetic, and more features. | ||
|
|
||
| (https://www.howtogeek.com/68563/htg-explains-what-are-the-differences-between-linux-shells/) | ||
|
|
||
| ### What is the difference between Terminal, Console, Shell, and Command Line? | ||
| - terminal = text input/output environment | ||
| - console = physical terminal | ||
| - shell = command line interpreter | ||
| - command line = interface where you type text commands, usually within a shell, accessed through a terminal | ||
|
|
||
| (https://askubuntu.com/questions/506510/what-is-the-difference-between-terminal-console-shell-and-command-line, chatGPT) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo found: "gget" should be corrected to "get" in this line.