CHAPTER TWO: CLIMBING THE TREE Flashcards

(67 cards)

1
Q

Directory: /

A

The root. Start of everything

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

Directory: /home

A

Default location for regular users files

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

Directory: /root

A

Home folder for root user

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

Directory: /etc

A

System settings and configuration files

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

Directory: /bin

A

Essential programs used by everyone

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

Directory: /sbin

A

Systems used by admins

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

Directory: /lib

A

Code libraries used by programs

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

Directory: /opt

A

Extra software

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

Directory: /tmp

A

Temporary files (cleared often)

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

Directory: /var

A

Logs and files that constantly change

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

Directory: /proc

A

Info about running processes

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

Directory: /usr

A

Shared files and apps for all users

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

Root user

A

The superuser who is allowed to do anything on the system. Can install software, add users, manage disk partition’s. /root is the home directory.

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

Directory separator

A

In linux root is the forward slash / and also the directory separator or path separator. The first / is the root and after that they become path separators

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

Current working va parent directories

A
  1. Current working directories (.)
  2. Parent directories (..)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Command: cd

A

Change directory

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

Go to root directory with cd

A

Cd/

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

Go to your home directory with cd

A

Cd~

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

Go back one folder with cd

A

Cd..

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

Go back to where you just came from with cd

A

Cd-

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

Go back into a specific path with cd

A

Cd/home/username/desktop

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

Listing files with is to show more detail

A

Is-l

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

Include hidden files with is

A

Is-a

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

Combine both more detail and hidden files with is

A

Is-la

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
How do you know what file is hidden?
Starts with a dot : .bashrc
26
Absolute path
Starts with / and points from the root. It is simply the full path of that file and it always begins with a forward slash
27
Relative path
A relative path file never starts with the root and is always relative to the current working directory
28
.
Current directory
29
..
Parent directory
30
~
Your home directory
31
Argument
Command line argument is simply any filename or data that is provided to a command as an input. In linux we use verb pass when talking about command options and arguments.
32
Touch command has what two purposes
1. Create new empty files 2. Update timestamps on existing files
33
Touch command creating new empty files
Example: touch file1.txt This creates a new file named file1.txt in your current folder. If the file already exists, it doesn’t change the contents just updates the timestamp.
34
Touch command updating timestamps on existing files
Each file has a timestamp what shows when it was last accessed or modified. Touch can update the timestamps without changing the contents.
35
Touch command for both access and modification
Touch filename.txt
36
Touch command only update modification timestamps
Touch-m filename.txt
37
Touch command update only access time
Touch-a filename.txt
38
Make directory (mkdir)
Used to create new folders (directories) in filesystem.
39
Create multiple folders at once with mkdir
Mkdir folder1 folder2 folder3
40
Create nested (sub) directories with mkdir
Use the -p option to create a full path even without middle folders Mkdir -p parent/child/grandchild
41
Using curly brace for multiple subfolders with mkdir
Mkdir -p main/{docs,image,videos}
42
Combine option: -1
Long listing (permissions, size, time)
43
Combine option: -a
Show hidden files
44
Combine option: -d
Show directory itself, not its contents
45
Combine option: -t
Sort by modification times (newest first)
46
Combine option: -u
Sort or show access time
47
Combine option: -r
Reverse order
48
Combine option: -R
Show all subfolders (recursive)
49
What does cat file.txt do?
Shows the contents of a text file
50
What does whoami do?
Shows the current user
51
What does su username do?
Switch to another user (need password for this)
52
What is cron?
It’s like a personal assistant for linux that handles scheduling tasks for you. Typically used for handling more than one task
53
What is crontab?
Cron table. It’s a file where you list the tasks you want cron to preform and when to preform them.
54
What is a cron job
Each line in this the crontab represents a scheduled taks. This is a cron job.
55
Command: crontab -I
View exisiting jobs.
56
Command: crontab -e
Edit your cron jobs
57
Command: crontab -r
Remove cron jobs
58
Keywords in cron: @reboot
Run once when the system starts
59
Keywords in cron: @daily
Run once a day at midnight
60
Keywords in cron: @weekly
Once a week at midnight on sunday
61
Keywords in cron: @monthty
Once a month at midnight on the first day
62
What is the at command
Almost like a reminder note for your computer. It lets you schedule your computer to do one task one time in the future. Used to run a command at a specific time.
63
How to use at command
1. Check if its installed using -v. If it shows a version number your good if it says something like command nut found. Install it using sudo apt install at 2. Start the atd service (which is a background helper that runs your scheduled task) type sudo systemctl start atd 3. Schedule your task and press crtl + alt + d to save and exit
64
How to check what you have scheduled with at command
Type Atq
65
Remove task with at command
Atrm [job number]
66
What is linux automation
Automation is like having a robot do task like cleaning files or copying date for you, exactly how you want, every single time. Linux Auto teaches your computer to do stuff automatically
67
What tools help with linux automation
1. The shell (read, talk and type to your computer. Most common is bash) 2. Shell scripts (these are just files you write down a bunch of commands in the order you want them to run) - nano nyscript.sh - this opens simple editor - to run script: bash myscript.sh 3. Crontab (schedules planner) 4. Ansible (more advanced) it is like a super-powered automation tool. Most for many computers at once. Uses something called playbooks (like scripts just fancier)