This repository provides a comprehensive guide to Linux shells, including their types, uses, and commands. It also includes instructions on how to install and change shells.
A shell is a command-line interface that allows users to interact with the operating system. It interprets user commands and executes them.
- One of the earliest shells in Unix systems.
- Lightweight and efficient.
- Limited interactive features.
- Most commonly used shell in Linux.
- Supports scripting and job control.
- Has command history and auto-completion.
- Syntax similar to C programming language.
- Better suited for scripting tasks.
- Includes job control and command history.
- Combines features of both Bourne and C shell.
- Improved scripting capabilities.
- Used in commercial Unix systems.
- Extended version of
bashwith more features. - Supports plugins and themes.
- Includes auto-correction and path expansion.
- Command Execution: Runs system commands and scripts.
- Scripting: Automates repetitive tasks using shell scripts.
- Process Management: Starts, stops, and manages processes.
- File Management: Creates, moves, and deletes files.
- System Administration: Configures the system and manages users.
echo $SHELL-
List available shells:
cat /etc/shells
-
Change the default shell:
chsh -s /bin/zsh # Replace /bin/zsh with your desired shell -
Restart terminal or log out and back in for changes to take effect.
ls– List files and directoriesls -l # Long listing formatcd– Change directorycd /home/usermkdir– Create a new directorymkdir myfolder
rm– Remove files or directoriesrm myfile.txt
ps– Display running processesps aux
kill– Terminate a processkill 1234 # Replace 1234 with the process ID
whoami– Display current userwhoami
chmod– Change file permissionschmod 755 myscript.sh
chown– Change file ownershipchown user:group myfile.txt
ping– Check connectivity to a serverping google.com
curl– Fetch data from a URLcurl -O http://example.com/file.zip
- Ubuntu/Debian:
sudo apt update && sudo apt upgrade - CentOS/RHEL:
sudo yum update
- Arch Linux:
sudo pacman -Syu
This guide provides an introduction to Linux shells and essential commands. Mastering the shell enhances system administration and productivity.