DEV Community

Cover image for Exploring the Fundamentals: A Comprehensive Guide to Linux for Beginner
Shamim Ansari
Shamim Ansari

Posted on • Updated on

Exploring the Fundamentals: A Comprehensive Guide to Linux for Beginner

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

  • Touch Command -
    Image description

Image description

  • 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

  • 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
Note: r = read, w = write, x = execute

  • rm -rf * - To remove all file/directory in single command

Follow me on Linkedin, Twitter

Top comments (2)

Collapse
 
uzair004 profile image
Muhammad Uzair

Nice, content should be organized.

Collapse
 
msfaizi profile image
Shamim Ansari

Nice