"This repository contains essential shell scripts for automating tasks, system administration, and DevOps workflows. It includes scripts for file management, process control, network monitoring, and more, with a focus on simplicity and efficiency."
This repository contains essential shell scripts for various system administration tasks, automation, and DevOps workflows. Below are some of the primary shell commands used in the scripts along with descriptions.
shebang #!/bin/bash
The echo
command is used to display a message or text on the terminal. Commonly used for printing status messages or outputs in scripts.
echo "Hello, World!"
The ls
command lists the files and directories in the current working directory. Useful for checking contents and verifying file locations.
ls -l
The cd
(change directory) command is used to navigate between directories in the shell.
cd /path/to/directory
Displays the current working directory.
pwd
The cp
command is used to copy files or directories from one location to another.
cp source.txt destination.txt
The mv
command moves or renames files and directories.
mv oldname.txt newname.txt
Used to remove files or directories.
rm filename.txt
Creates an empty file or updates the timestamp of an existing file.
touch newfile.txt
Changes the permissions of a file or directory.
chmod 755 script.sh
Searches for specific patterns within files.
grep "search-term" file.txt
Searches for files in a directory hierarchy.
find /path/to/search -name filename.txt
Displays a list of running processes.
ps aux
Displays real-time information about running processes, including CPU and memory usage.
top
Shows disk space usage of file systems.
df -h
Displays disk usage of files and directories.
du -sh /path/to/directory
Used to compress or extract tarball (.tar) archives.
tar -czvf archive.tar.gz /path/to/folder
Transfers data from or to a server, often used for interacting with APIs.
curl https://api.example.com
Downloads files from the web.
wget https://example.com/file.zip
A powerful text processing tool used for pattern scanning and processing.
awk '{ print $1 }' file.txt
Stream editor used for modifying and transforming text in files.
sed 's/old/new/g' file.txt
A simple command-line text editor, easy to use for quick file editing.
nano script.sh
A more advanced text editor with powerful features for editing code. Requires knowledge of Vim commands.
vim script.sh
A graphical text editor for GNOME environments, useful for editing scripts in a user-friendly interface.
gedit script.sh
Feel free to contribute by adding more commands or improving existing scripts!