Environment & Redirection Flashcards
(10 cards)
PushD
The pushd command takes your current directory and “pushes” it into a list for later, then it changes to another directory. It’s like saying, “Save where I am, then go here.
On Unix pushd, if you run it by itself with no arguments, will switch between your current directory and the last one you pushed.
PopD
The popd command takes the last directory you pushed and “pops” it off, taking you back there.
What is | ?
Piping. This moves the output of one process to the input of another process
What is > or < ?
This redirects output of a process to replace the contents of a file
What is»_space; or «_space; ?
This appends output of a process to an existing file
echo $HOME
This calls to output the value of the variable HOME
How do you set variables?
Don’t use $ sign. Just set it. PS1=”\u \w $”
“Find?”
Find looks for file or folder names find . -name “hello.txt” MAN find for help
“Grep?”
Looks for Global Regular expression Print. basically searches inside a file. -n lists the output’s line numbers. GREP is case sensitive. Just pass -i option to make case Insensitive. Pass -v option to INVERT or provide the negative outcome. MAN grep for help
Apropos?
Apropos finds help similar to MAN