0
0
Linux CLIscripting~5 mins

First Linux commands in Linux CLI - Commands & Configuration

Choose your learning style9 modes available
Introduction
Linux commands let you talk to your computer using text. They help you see files, move around folders, and check what is inside your computer.
When you want to see what files are in a folder on your computer
When you need to know which folder you are currently working in
When you want to create a new folder to organize your files
When you want to move into a different folder to work with files there
When you want to see the contents of a file quickly
Commands
This command shows you the full path of the folder you are currently in. It helps you know your exact location in the computer's folder system.
Terminal
pwd
Expected OutputExpected
/home/user
This command lists all files and folders in your current folder. It helps you see what is inside without opening anything.
Terminal
ls
Expected OutputExpected
Documents Downloads Music Pictures Videos
-l - Shows detailed information about files and folders
-a - Includes hidden files in the list
This command creates a new folder named 'myfolder' in your current location. Use it to organize your files better.
Terminal
mkdir myfolder
Expected OutputExpected
No output (command runs silently)
This command moves you into the folder named 'myfolder'. It changes your current working folder to where you want to work.
Terminal
cd myfolder
Expected OutputExpected
No output (command runs silently)
This command shows the content of the file named 'example.txt' right in the terminal. It helps you read files quickly without opening an editor.
Terminal
cat example.txt
Expected OutputExpected
This is an example text file. It has multiple lines.
Key Concept

If you remember nothing else, remember: 'pwd' shows where you are, 'ls' shows what's there, 'mkdir' makes a folder, and 'cd' moves you around.

Common Mistakes
Typing 'cd' with a folder name that does not exist
The command fails because the folder is not found, so you stay in the same place.
Use 'ls' first to check the folder name, then type 'cd' with the exact folder name.
Using 'ls' without flags and expecting detailed info
'ls' alone only shows names, not details like size or date.
Add '-l' flag to see detailed information: 'ls -l'.
Trying to 'cat' a file that does not exist
The command returns an error because the file is missing.
Check the file name with 'ls' before using 'cat'.
Summary
Use 'pwd' to find your current folder location.
Use 'ls' to list files and folders inside the current folder.
Use 'mkdir' to create a new folder.
Use 'cd' to move into a folder.
Use 'cat' to read the contents of a file.