Bash Guide for Beginners

Bash is the default shell on many Linux systems. Learning a few basics makes it easier to navigate files, run commands, automate small tasks and understand server instructions.

Start with simple commands

pwd
ls
cd /var/log
mkdir test
cp file1 file2

Use variables

name=linux
echo "Hello $name"

Create a small script

#!/bin/bash
echo "Today is $(date)"

Save the file, make it executable, and run it.

chmod +x script.sh
./script.sh

Good beginner habits

  • Quote variables when they may contain spaces.
  • Test commands before using them in loops.
  • Be careful with commands that remove or overwrite files.
  • Use man or --help to check options.

Leave a Comment