Common Bash Commands
Bash commands are how you interact with the operating system and perform tasks.
Common commands
- ls - List directory contents
- cd - Change the current directory
- pwd - Print the current working directory
- echo - Display a line of text
- cat - Concatenate and display files
- cp - Copy files and directories
- mv - Move or rename files
- rm - Delete files or folders
- touch - Create an empty file or update its time
- mkdir - Create a new folder
All these commands and more are explained in the following chapters.
Example
Here's an example using some of these commands:
Example
mkdir my_directory
cd my_directory
touch my_file.txt
ls
my_file.txt