0% found this document useful (0 votes)
6 views19 pages

Bash & Shell & Git

Uploaded by

Qudus Lawal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views19 pages

Bash & Shell & Git

Uploaded by

Qudus Lawal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

BASH & ZSH SHELL

TERMINAL
BASH &
ZSH SHELL
TERMINAL
What are Bash & zsh Terminals?
Shell terminals, such as Bash and zsh, are text-based user
interfaces for interacting with an operating system.

They allow you to input commands through a command line,


offering direct communication with the system for tasks like file
manipulation, program execution, and system control.

Bash is common on Linux systems and zsh is the default on


MacOS systems.
Bash & zsh Terminal
Some quick checks
The working directory is the directory that commands are executed
from. By default, commands will read and write files to this directory.
The root directory is the top of the file system. All other directories are
contained within the hierarchy of this directory.
An absolute path starts from the root directory. Think of it like latitude and
longitude - the values to a location don't change wherever you are.
A relative path starts from the working directory. Think of it like
directions from where you are, like "20 kilometers West from here".
A glob pattern is a way of specifying multiple files at once.
File System
Navigation
Print the current working directory with pwd

Change the current working directory with cd


File System Navigation

Absolute paths start with the root directory, /

Relative paths can start with the current working directory, .


File System Navigation

Move up to the parent directory with .. (can be used repeatedly)

List files and folders in the current working directory with ls


File System Navigation

List all files and folders, including hidden ones (names starting .) with ls -a

List files and folders in a human-readable format with ls -lh


File System Navigation

List files and folders matching a glob pattern with ls pattern

Recursively list all files below the current working directory with ls -R
File System Navigation

List estimated disk usage of files and folders in a human-readable format with du -ah

Find files by name in the current directory & its subdirectories with find . -type f -name
pattern
Displaying
Files
Display the whole file with cat

Display a whole file, a page at a time with less


Copying, Moving
and Removing
Files
Copy (and paste) a file to a new directory with cp

Copy files matching a glob pattern with cp pattern newdir


Rename a file by moving it into the current directory using the mv

Move (cut and paste) a file to a new directory with mv


Move files matching a glob pattern with mv pattern newdir

Remove (delete) a file with rm

Remove a directory with rmdir


Copy (and paste) a file to a new directory with cp

Copy files matching a glob pattern with cp pattern newdir

You might also like