Shell

0.0(0)
studied byStudied by 1 person
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/21

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

22 Terms

1
New cards
When is the .profile file loaded?
Once, when you login into your os
2
New cards
When is the .rc file loaded?
Every time you start a new terminal.
3
New cards
What was the default shell in UNIX 7?
The Bourne Shell (sh) created by Stephen Bourne.
4
New cards
Is there only 1 shell?
No, There are a lot of different shells.
5
New cards
Does the Bourne Shell load the .rc file?
No.
6
New cards
What was the replacement of the Bourne Shell (sh)?
The Bourne shell is mostly dead by now and was replaced with bash (Bourne Again Shell) or on newer Linux versions, with dash.
7
New cards
Name another very popular shell.
zsh (Z Shell)
8
New cards
If you want to add a path to your PATH variable that should be permanent, where to add it?
You need to do it in either the .profile or .rc file, otherwise it will get lost once you restart the terminal.
9
New cards
How do I add an alias?
To add a new Alias, go into your .rc file and add it with: alias aliasname=command
10
New cards
What does the $SHELL command tell you?
The current shell you are using.
11
New cards
How can I check if my default shell is just a symlink to another shell?
Go into the directory of the default shell and run ls -lah. This is often used to symlink sh to bash.
12
New cards
What does the $PWD environment variable stand for?
Print working directory.
13
New cards
How can you create a symlink?
Use the command ln -s FILE DESTINATION.
14
New cards
How can you see all registered shells?
Cat the content of /etc/shells.
15
New cards
How can you get a list of all environment variables?
Use the command export -p.
16
New cards
What does the $ sign in the terminal represent?
The $ sign in the terminal stands for a variable.
17
New cards
How can you use the result of one command inside another?
You can use a variable: echo that is the path for $(which brew)
18
New cards
How can you directly access a binary file from anywhere if its directory is registered in your path?
By simply typing the name of the binary file in the command line.
19
New cards
How can you change the default shell to zsh as example?
chsh -s $(which zsh)
20
New cards
How can you check the directories that are registered in your path?
echo $PATH
21
New cards
An alternative to see the location of a command: command -v brew
which brew
22
New cards
\