Command Line Essentials Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

How do you list the content of a directory?

A

LS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you change de directory in which you are in ?

A

CD

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you go back one directory

A

cd ..

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you use two commands in the same line?

A

With ; for exemple cd .. ; ls

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to discover wich directory you in?

A

pwd (print working directory)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to list your home directory?

A

ls ~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How would you download html of the google homepage using command line?

A

curl -o google.html (this is the file name we want to save under) -L ‘http://google.com’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How would you read the file dictionary.txt?

A

cat dictionary.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How would you read the file dictionary.txt partially?

A

less dictionary.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does de grep command do?

A

grep stands for “global regular expression unit”. It process text line by line and prints any lines which match a specified pattern

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

And what does the command wc do?

A

It is short for “word count” it reads either a standartd input or a list of files and generante one or more of the following statistics: newline count, word count, and byte count

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are environment variables?

A

Are viarables shared with programas run within the shell.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the PATH variable?

A

It is one environment variable very important that tell your system where your program files are. So, when you type a command such as ls, it can find the program to run it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does it mean to customize your shell?

A

There are situations that you would like to install programs in the subdirectory bin (binary). But the shell does not come pre-configured to know that there is any commands there. In order to add that directory into your $PATH variable you need to put it in the shell configurations file.

On a Mac, or in a Windows system with Git Bash, the shell in every terminal you open will run the commands in a file .bash_profile.

In a Linux, although there is .bash_profile it is used for so many sessions. For other sessions there is .bashrc file.

Any command you put in these configuration files will run every time you start the shell. That includes variable assignments like changing $PATH.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

There’s a lot of informations you cant put in the shell prompt. How you do that??

A

In order to use codes you want, you put them in the PS1 shell variable, generally in the .bash_profile, or in the .bashrc if your are on Linux

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

In order to be productive, how would you assign a shorter alias to commands?

A

Using the command alias: alias ll=’ls - la’ for instance.
To list all the aliases you have, just runs the command ‘alias’ with no arguments.

Remember that the alias will last as long as that terminal is open. If you want it to always be there when you start your shell, you put it in the .bash_profile.