Exploring the Fundamentals: A Comprehensive Guide to Linux for Beginner
Tags: devops, linux, cicd, opensource
Published: 2023-09-30 10:06:35

**Linux:**
- Linux is kernel not OS
- Linux is not a UNIX derivative. It was written from scratch
- A Linux distribution is the Linux kernel and a collection of software that together creates an OS.

**Linux Features:**
- Open source
- Secure
- Simplified updates for all installed software
- Light weight
- Multi-User or Multi-Task
- Multiple distributions – RedHat, Debian, Fedora etc.

**File System Hierarchy:**
`/home - home directory for other user
/root – It is home directory for root user
/boot – It contains bootable files for Linux
/etc -  It contains all configurations files.
/usr – By default software are installed in this directory
/bin – It contains commands used by all users
/sbin -  It contains commands used by only root user
/opt – Optional application software Packages
/dev – Essentials device files. This includes terminal devices, usb or any devices attached to the system.`

**Linux Commands & It’s use cases:**

- **cat command**
 – The cat command is one of the most universal tools, yet all it does is Copy standard input to Standard Output.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/htjvvv8x4qk1dqca8qq4.png)

- **Touch Command** - 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s8q0y31uzq97r0vutfx1.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/axz2oib66fdq7z1npj88.png)

- **Vi editor -**

1. A programmer text editor
2. It can be used to edit all kinds of plain text, it is specially useful for editing programs, mainly used for Unix programs.

_Notes:_           `:w – to save
                    :wq or :x – To save and quit
                    :q – quit
                    :q! – force quit, no save`
_Vi is a standard whereas ‘nano’ has to be available depending on the linux we use._  
  
`rmdir – This command is used to remove the specified directory (empty)
rmdir -p – Removes both the parent and child directory
rmdir -pv – Removes all the parent and sub-directories along with verbose.
rm -rf – Removes even non-empty file and directory.
Rm -rp – Removes non-empty directories including parent and sub directory.
rm -r – Removes empty directory
 hostname
Ifconfig, cat /etc/os-release
yum install httpd
yum remove httpd
yum update httpd
service httpd start
service httpd status
chkconfig httpd on
chkconfig httpd off
which
whoami
echo
yum list intalled
useradd- To create user
groupadd – To create a group
gpasswd -a/-m – To add user into group, to add multiple user
ln – Hardlink/ backup
ln -s – Softlink/ short cut
tar – Tar is an archiver used to combine multiple files into one
gzip – It is a compression tool used to reduce the size of a file
wget – It is the non-intracity network downloader.`

**Access mode/ Permission:**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/59k2utzt93c9zsjiobzv.png)

- **chmod** – Used to change the access mode
- **chown** – Change the owner of the file or directory
- **chgrp** – Change the group of file or directory 

File Details: 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iv307vtj4w4fzu8q7rkg.png)
_Note_: r = read, w = write, x = execute
- rm -rf * - To remove all file/directory in single command

Follow me on [Linkedin](https://www.linkedin.com/in/shamim-ansari7/), [Twitter](https://twitter.com/shamim_faizi786)