Commit 3cf34e5e authored by Jyothis Jagan's avatar Jyothis Jagan
Browse files

Initial commit of session 1 notes.

parent 2b537941
# Shell and Kernel
Refer [UNIX / Linux : What Is a Shell? What are different Shells?](https://www.thegeekdiary.com/unix-linux-what-is-a-shell-what-are-different-shells/ "UNIX / Linux : What Is a Shell? What are different Shells?")
> A shell is a program that provides an interface between a user and an operating system (OS) kernel. An OS starts a shell for each user when the user logs in or opens a terminal or console window.
> A kernel is a program that:
> * Controls all computer operations.
> * Coordinates all executing utilities
> * Ensures that executing utilities do not interfere with each other or consume all system resources.
> * Schedules and manages all system processes.
> By interfacing with a kernel, a shell provides a way for a user to execute utilities and programs.
## Different Shells
* Bourne Shell(sh)
* C Shell(csh)
* Korn Shell(ksh)
* GNU Bourne-Again Shell(bash)
* Z shell(zsh)
# Basic Commands
Refer [How to Manage Files from the Linux Terminal: 11 Commands You Need to Know](https://www.howtogeek.com/107808/how-to-manage-files-from-the-linux-terminal-11-commands-you-need-to-know/ "How to Manage Files from the Linux Terminal: 11 Commands You Need to Know")
1. ls – List Files
2. cd – Change Directory
3. rm – Remove Files
4. rmdir – Remove Directories
5. mv – Move Files
6. cp – Copy Files
7. mkdir – Make Directories
8. ln – Create Links
9. chmod – Change Permissions
10. touch – Create Empty Files
11. mc – A Full File Manager (TUI - Terminal User Interface)
# Filesystem Hierarchy Standard
Refer [Filesystem Hierarchy Standard](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html "Filesystem Hierarchy Standard")
## /bin
* Essential user command binaries (for use by all users)
## /boot
* Keeps files required to boot your system
* Contains compressed linux kernel
* Used to edit grub configurations
## /dev
* Device files
## /etc
* Host-specific system configuration like hostname, ip address, dns server address, list of users and groups etc.
* /etc/hosts can be used as a simple local DNS system.
* /etc/resolv.conf specifies the nameservers for resolver lookups.
* everything in /etc/skel gets copied to home directory of newly created user
## /home
* User home directories
## /lib
* Essential shared libraries and kernel modules
## /media
* Mount point for removable media
## /mnt
* Mount point for a temporarily mounted filesystem
* Commonly used as a place for adding new file systems, unlike Windows, which has A: B: C: for different disks/partitions (A: & B: are reserved by floppy disk drives)
## /opt
* Add-on application software packages that are not part of the official distro or system.
* Used by independenct software vendors, like some IBM software or Java.
## /root
* Home directory for the root user
## /run
* Run-time variable data
* usually used for lock files and sockets
## /sbin
* System binaries
## /srv
* Data for services provided by the system
* chroots are usually created there
* Used by ftp server to store data
## /tmp
* Temporary files
## /usr
* only package manager is supposed to write to /usr.
### /usr/local
* It is for system administrators, for example if we create some custom scripts, we can add it in /usr/local/bin.
## /var
* Any file that keeps growing during the system operation goes to /var. examples includes log files, database files, debs downloaded by apt etc.
* Any running program should only write important data (that should be persisted during reboots) to /var or to /home.
### /var/cache
* Usually used for data that could be removed without much issues (things that could be downloaded again)
* /var/cache/apt/archives contains .deb files downloaded by apt.
### /var/lib
* Contains important data, usually database programs keep their data there.
# Environment Variables
Refer [Bash Environment Variables Tutorial](https://linuxhint.com/bash-environment-variables/ "Bash Environment Variables Tutorial")
* $HOME - the path to the home directory of the user.
* $PATH - directories in which the shell looks for commands.
* $PS1 - first prompt string.
# Miscellaneous
## Hidden Files
* Starts with dot(.)
* Usually used for user specific configurations.
* .bashrc is used for configuring bash. .bashrc file can be found in home directory for each user.
* Use `ls -a` in your home directory, you will see all of them
* ~/.ssh is a hidden directory.
# Tasks To Do
When : Whenever you feel confident of trying!
if you don't set a password some one who has physical access to your system can get a root shell without requiring your password.
1. Get root access to your system via grub without entering the password.
2. Set a password for your grub.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment