Command Line Essentials Flashcards
How do you list the content of a directory?
LS
How do you change de directory in which you are in ?
CD
How do you go back one directory
cd ..
How do you use two commands in the same line?
With ; for exemple cd .. ; ls
How to discover wich directory you in?
pwd (print working directory)
How to list your home directory?
ls ~
How would you download html of the google homepage using command line?
curl -o google.html (this is the file name we want to save under) -L ‘http://google.com’
How would you read the file dictionary.txt?
cat dictionary.txt
How would you read the file dictionary.txt partially?
less dictionary.txt
What does de grep command do?
grep stands for “global regular expression unit”. It process text line by line and prints any lines which match a specified pattern
And what does the command wc do?
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
What are environment variables?
Are viarables shared with programas run within the shell.
What is the PATH variable?
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.
What does it mean to customize your shell?
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.
There’s a lot of informations you cant put in the shell prompt. How you do that??
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