Linux- is an open-source OS modeled on UNIX/ freely available/ multiuser system
Founder- Linus Torvalds in 1991
Linux=Kernel( program that constitutes the core of an OS/ the core of the system and manages the CPU, memory, and peripheral devices.) Lowest level of the OS
Operating System (OS)- what allows a user to tell the computer and hardware, what to do. Manages all the hardware resources associated with that desktop or laptop.
The communication between the software and the hardware
Patches- changes broke into individual units in the linux kernel (change/added/removed) These changes can rework things, improve performance, fix a problem, add new support for a device, add a new feature, etc.
Bootloader- software that manages the boot process of the computer
Bootstrapping- the process of starting up a computer/ creating a compiler
Init system- a sub-system that bootstraps the user space and is charged with controlling daemons. Manages the boot process
Daemons- background services (printing, sound, scheduling, etc) that either start up during boot or after logging into the desktop
Daemon processes- run in the background, waiting for request to come in
Graphical server- the sub-system that displays the graphics on the monitor (X server or X)
Desktop Environment- the piece that users actually interact with
Applications- apps/ just like you find on the App Store
Distribution (distros) - different versions of Linux to suit any type of user. (i.e: LINUX MINT, MANJARO, DEBIAN, UBUNTU, SOLUS, FEDORA, ELEMENTARY OS, OPENSUSE)
Live Distribution- can run the OS from either a CD/DVD or USB flash drive without making any changes to hard drive. Commitment without the installation.
Features that make up Linux and similar computer OS:
• Detecting and preparing hardware (booting up and looking at the components on the computer (CPU, hard drive, network cards and so on) and loads the software (drivers and modules) needed to access those particular hardware devices
• Managing processes (OS keeps track of multiple processes running at the same time and determines access to the CPU. Also must offer ways of starting, stopping and changing status of processes)
• Managing memory (RAM and swap spaces(extended memory) must be allocated to apps as they memory. OS decides how requests for memory are handled.
• Providing user interfaces (provide ways of accessing the system.
• Shell (Command-line interpreter) a program that takes keyboarding commands and passes them to the operating system to carry out
• Shell Prompt- appears whenever the shell is ready
• Terminal emulator- a program to interact with the shell when using a graphical user interface
• Controlling filesystems ( Filesystem structures are built into the OS or loaded as modules. The OS controls ownerships of and access to the files and directories that filesystem contains.
Providing user acces and authentication Creating user accounts and allowing boundaries to be set between users
• Offering administrative utilities commands and graphical windows available to do things such as add users, manage disks, monitor the network, install software, and generally secure and manage the computer
• Starting up services To use printers, and log messages, and provide a variety of system and network services
• Programming tools- variety of programming utilities for creating apps and libraries for implementing speciality interfaces
• Clustering- Linux is configured so that multiple systems can appear as one system to the outside world. Services can be configured to pass back and forth between cluster nodes, while appearing to those using the services that they are runnning without interruption.
• Virtualization- helps manage computing resources more efficiently
• Cloud computing- To manage large-scale virtualization environments/ can simultaneously manage many virtualization hosts, virtual networks, user and system authentication, virtual guest, and networked storage
• Real-time computing- Linux can be configured for real-time computing
• Specialized storage- Specialized local and networked storage interfaces instead of storing data on the computer's hard disk
Basic Linux Commands (typically lowercase):
ls / ll Lists directory contents.
cd Changes the current directory.
$cd
$cd/ home/username
$cd...--Move up on level
** pwd Displays the present, working directory.
cat Concatenates and displays files / displays the contents of a text file
echo Displays arguments to the screen.
man Displays the online manual.
• while moving inside pages use less key commands to navigate
• H or h display help
• Page Down, spacebar, Ctrl + V, Ctrl + F moves down one screen
• CPage Up, Esc + V, Ctrl + B moves up one screen
• Down Arrow, Enter, Ctrl+N, Ctrl+E, Ctrl+j moves down one line
• Up Arrow, y, Ctrl+y, +P, +K moves up one line
• /pattern searches forward (pattern)
ie: /forward
/output
• ?pattern searches backward on (pattern_
• n or / repeat the previous search
• Q or Q or ZZ quits
exit Exits the shell or your current session.
clear Clears the screen
touch Creates an empty file.
id Prints real and effective user and group ids.
who Shows who is logged on.
w Shows who is logged on and what they are doing.
uname Prints system information.
whoami Prints effective user id CLEA
mkdir To create directories:cati
$mkdir directory1
$mkdir DIRECTORY1 (NOT A GOOD IDEA!)
$mkdir linuxforjobs$mkdir linux for jobs
passwd Changes the password for a given user
$passwd
$passwd username
$passwd lucy
less Reads a file (little by little)
head/tail Reads the first (or last) 10 lines of a file
find Locates files on a system
grep Searches for a string on our file
sort Organizes text in a file
wc Counts words inside a file
vi- Text editor (always available to linux)
vi filename Edit file
vim filename Same as vi, but more features (such as syntax
view filename Starts vim in read-only mode
How to Build a Command
• Command ( what to do)
letters typed while in command mode are not sent to the file, they are interperted as commands
• Options (how to do) (usually one character with a dash in front of it. When you combine options you don't space them)
• Arguments (what to do it with)MDIRVI
Examples:
ie: $grep -i zoe /home/users
ie: touch -r time
ie: touch -r0 time (includes two options) also can be written
touch -r-0 time
ie: grep zoe / home/users (command +arguments)
ie: touch -r -o -t time (includes three options)
ie: man touch
Spaces after each command
Forward slash- placement/ doors (think like a file in a folder)
3 Types of Modes (vi)
• Command Mode
• Insert Mode
• Line Mode
Navigating in vi Text Editor
k Up one line
j Done on line.
cp
h Left on character
l Right one character
w Right one word
b Left one word.
^ Go to the beginning of the line
$ Go to the end of the line
i Insert at the cursor positon
I Insert at the beginning of the line (uppercase I)
a Append after the cursor position
A Append at the end of the line
vi Line Mode
:w Writes(saves) the file
:w! Forces the files to be saved
:q Quit
:q! Quit without saving changes
:wq! Write and quit/ save and quit
:x Same as :wq
:n Position the cursor at line n
:$ Position the cursor on the last line
:set nu Turn of line numbering
:set nonu Turn off line numbering
:help [subcommand] Get help
vi Modes
Mode Key
Command esc
Insert i, a or A
Line :
vi Delete text
x Delete
dw Delete word
dd Delete a line
D Delete from cursor positon
r Replace the current character
yy Copy the current line
p Paste the most current copied text
Undo, Redo and Searching
u Undo
Ctrl-R Redo
/ Start a forward search
? Start a reverse search
Practicing vi
• To create a new file use the vi command:vi test.txt• -
• Press i to start inserting text– Type some text: Hello Class– To save and quit, press “Esc” key, and enter :wq!•
• (press the enter key after typing :wq!)– To quit without saving, press “ Esc ” key if in insert
• mode, and enter “:q!”
What is dynatrace ?
• global tech company
• provide software observabililty platform based on AI (artificial intelligence) and automation
• dynatrace technologies are used to monitor, analyze and optimize application performance, software developt=ment an dsecurity practies , IT infrastrure and user experience
What is Debian
Study Tips
• Make font bigger on Virtual box- Go to view and scroll to Virtual Screen then scale to 100% or 150%
• Command Prompt- blinking cursor
• Linux is case sensitive, can't create files with the same name
• ll is the same as -l
• To properly shut down virtual box type in shutdown and wait for it to shut down, dont use the x at the top
regular user/ standard user $
~ HOME DIRECTORY OF WHERE I AM
a directory is similar to a folder
a subdirctory is directory within a directory
a directory can have other directories and files
a file cant have other fies in it- files can have text
Full Path
ie: [root@localhost unitedstates]# touch /yellowtail/unitedstates/newyork/statueofliberty
Relative Path- realtive to where you are
ie: [root@localhost unitedstates]# touch newyork/timessquare
/ location
[root@localhost/]#
distributions-are complete operating systems based on the Linux kernel. they bundle the kernel with various tools, applications and utilities to provide a ready-to-use environment
Popular Distributions /"distros"/flavors- Debian, Red Hat, Ubuntu
can create a subdirectory under a subdirectory with option -p (parent directory)
verify with ls or ls -l
creating files at the same time:
ie: touch 2015/jan/cpu.txt 2015/motherboard.txt
Options:
mkdir -p directoryname/ subdir
p (parent)
v (verbose) - allows you to see whats being created while its created
mv- move
cp- copy files
rm- removing files
rm -r dir remove the directory and its contents recursively
rm -f filename force removal and never promt for confirmation
-r
recursively (down the line, down the row
cd..
ls ../..
/ root of the system
/bin binaries and othr executable programs
/etc home directories
/home
/opt
/tmp
/usr
/var
Copy
cp source_file destination_file
cp -r (copy directory)
mv -i (
rm -rf/ (deletes everything from the root
Find
find [path..] [expression]
Search by filename
-$find /etc -name crond (string-crond)
Search by permission mode
-$find /var -perm 700
Search by group
-$find /home -gid 66
Search by user
$find/home -user joe
$find /tmp -type d-perm 755
/ doesn't mean for directores, have to specify file or directory
d for directory
f for files
ls -l
-name
find [path] {what you are looking for }
find /
-type f -name yellowtail
find /root -name yellowtail -type f
Linux is case sensitive
- i (ignore case /both lower and uppercase)
find /root -iname yellowtail -type f
all terminals have gui (graphical interface)
click on application
bash-programming language
$ = standard user
# = root user
~ = home directory
/ = root of the directory
[teamwinnin@yellowtail~]$ this is a shell prompt
[teamwinnin@yellowtail/tmp]$
Wildcards
a character or string used for pattern matching
paths
* matches zero or more characters
ie:
*.txt =
ger.text apple.txt
telop.txt a.txt
yellw.txt atech.txt
testtxt all.txt
a*
la
lata
pla
placa
a*.txt
a*.txt
? - matches exactly one character slot
*.* (. is a placement)
?.* (
???
*.??
Character Classes
Character class- matches any of the characters included between the brackets
[ ]
{ } brace expansion / making files
\ to recognize a character
ie: new\york = 'new york'
files: can candy cat catch cot cin cit
ls c[jghhakdh]t
ls c [aoi]n
ls c [ai]*
must start with c
must have a or i
cat catch cin cit
S
ls c[!a.i]t
look for anything with c
exclusion
not1!hing with a or i
includes t
touch file(1..7) text(a..d}
ls f*[!111] 1?
-name (string of characters)
find /etc -f -name deny ( looking for files within the root that have any amount of characters with deny
find / -type f -name foo ( looking for files within the root of the system
-user (
User Management
Multiple users can access the system remotely at once, but need special permissions to access all the data
Accounts can have the following:
• username (or login ID)
• UID (user ID): a unique number
• Default group
• Comments
• Shell
• Home Directory location
/etc/passwd
format of the /etc/passwd:
username : password : UID : GID L comments : home_dir : shell
joe : x : 1000 : 1000 : Joe Henderson : /home/joe : /bin/bash
can see user accounts information
password placement
Verify user: cat /etc/passwd or id yellowtail
$ man passwd
/etc/shadow
Encrypted password used to be stored in /etc/passwd
/etc/passwd is readable by everyone
readable by root
prevents users trying to crack passwords
Root account- always UID 0
System accounts have UIDS < 1000 (1-999)
standard users start at 1000
Configured in /etc/login.defs
GID
listed in the /etc/passwd is the default group for an account
new files belong to a user's default group
users can switch groups by using newgrp / groupadd command. Mostly use groupadd command
Comment Field
• typically contains the user's full name
• often contains what the account is used for
• may contain additional informaton like phone numbers
• also call the GECOS field
Shell
• list of available shells are in /etc/shells
• the shell doesn't have to be a shell
• to prevent interactive use of an account, use /usr/sbin/nologin or /bin/false as the shell
• shells can be command line applications
Useradd
Create Password-passwd
Command Structure:
• # passwd [ option ] username
• # passwd grant
Enter new Unix password
Retype new Unix password
Successfully
More options
-g group ( Specify the default or primary group)
-G group1,group2 ( Used for additional groups or Secondary group)
- u (to specify the UID)
Deleting user
userdel
Command structure:
userdel [option] username
Modifying user
usermod
Command structure:
usermod [option] username
System Accounts
System - application accounts
created for a program that provides a particular service
not created for users to log in
groups - shows the groups a user is in
chage {change age}
allows you to modify account settings relating to account expiration
change -M 90 username
change -m 7 username
su
is used to open a shell as another user
to open a login shell
sudo
is a tool that allows an administratior to delegate authority, to give selet users (or group) the ability to run some or all te commands as root or anoter user
used to run tasks as another user
prompts for the password of the current user
authorization through /etc/sudoers /etc/sudoers.d/*
visudo - the command used to make changes to the file.etc.sudoesrs
do not edit this file directly (with text editors)
Wheel group
have sudo privileges by default
easiest way to give privileges to a user is to add them to the "wheel group"
Sudoers file is composed of two entries:
• Aliases (command aliases for example)
• User specifications (decides who can run what)
ctrl + c to get command stripe back