Command-Line Flashcards
What is a CLI?
command-line interface processes commands to a computer program in the form of lines of text. The program which handles the interface is called a command-line interpreter or command-line processor.
What is a GUI?
A graphical user interface (GUI) is a type of user interface through which users interact with electronic devices via visual indicator representations.
Give at least one use case for each of the commands listed in this exercise. man cat ls pwd echo touch mkdir mv rm cp
- man: This command displays the manual page for a particular command. If you are unsure how to use a command or want to find out all its options, you might want to try using man to view the manual page.
- cat: This command outputs the contents of a text file. You can use it to read brief files or to concatenate files together.
- ls: This command will list the files stored in a directory.
- pwd: This command reports the current directory path.
- echo: Echo is a Unix/Linux command tool used for displaying lines of text or string which are passed as
arguments on the command line. - touch: used to create a file without any content. The file created using touch command is empty. This command can be used when the user doesn’t have data to store at the time of file creation.
- mkdir: This command will make a new subdirectory.
- mv: This command will move a file. You can use mv not only to change the directory location of a file, but also to rename files. Unlike the cp command, mv will not preserve the original file.
- rm: This command will remove (destroy) a file.
10: cp: This command copies a file, preserving the original and creating an identical copy.
What is Node.js?
Node.js is a program that allows JavaScript to be run outside of a web browser.
What can Node.js be used for?
It is commonly used to build back ends for Web applications, command-line programs, or any kind of automation that developers wish to perform.
What is a REPL?
Node.js Read-Eval-Print-Loop (REPL) is an easy-to-use command-line tool, used for processing Node.js expressions. It captures the user’s JavaScript code inputs, interprets, and evaluates the result of this code. It displays the result to the screen, and repeats the process till the user quits the shell.
When was Node.js created?
May 27, 2009
What back end languages have you heard of?
PHP, Ruby, C#
Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
10 on Task Manager
What is a computer process?
instance of a computer program that is being executed by one or many threads.
Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
332 processes on task manager
Why should a full stack Web developer know that computer processes exist?
Because full stack web development is based on making multiple processes work together to form one app.
What is the process object in a Node.js program?
The process object is a global that provides information about, and control over, the current Node.js process.
How do you access the process object in a Node.js program?
As a global, it is always available to Node.js applications without using require(). It can also be explicitly accessed using require()
What is the data type of process.argv in Node.js?
array
What is a JavaScript module?
Each individual file. In the Node.js module system, each file is treated as a separate module.
What values are passed into a Node.js module’s local scope?
exports, require, module, __filename, __dirname.
What is the purpose of module.exports in a Node.js module?
Module exports are the instruction that tells Node.js which bits of code (functions, objects, strings, etc.) to “export” from a given file so other files are allowed to access the exported code.
How do you import functionality into a Node.js module from another Node.js module?
use require()
What is the JavaScript Event Loop?
event loop is responsible for executing the code, collecting and processing events, and executing queued sub-tasks.
What is different between “blocking” and “non-blocking” with respect to how code is executed?
Blocking refers to operations that block further execution until that operation finishes while non-blocking refers to code that doesn’t block execution. Or as Node.js docs puts it, blocking is when the execution of additional JavaScript in the Node.js process must wait until a non-JavaScript operation completes.
Blocking methods execute synchronously while non-blocking methods execute asynchronously.
What is a directory?
directories = folders, which allows the user to group files into separate collections.
What is a relative file path?
A relative file path points to a file relative to the current page.
What is an absolute file path?
An absolute file path is the full URL to a file
What is an absolute file path?
File path that starts at the root directory. (An absolute file path is the full URL to a file.)
What method is available in the Node.js fs module for writing data to a file?
fs.writefile
Are file operations using the fs module synchronous or asynchronous?
Every method in the fs module has synchronous as well as asynchronous forms, but using asynchronous method is preferred
What is a client?
user interface (whatever the user interacts with)