Table of Contents
๐ History of Linux
๐ง What is Linux?
๐ Basic Linux Commands
File Commands
Directory Commands
๐ History of Linux
Early 1990s: A guy named Linus Torvalds creates a basic computer program (kernel) as a hobby. He shares it with others.
1991: Linus releases the first version of his program called "Linux." It's like a heart for a computer, but it needs more parts to work well.
1990s-2000s: Many people join Linus and add those missing parts (software). They create different versions (distributions) of Linux, like Ubuntu and Red Hat.
2000s: Linux becomes popular for servers and later for smartphones (Android is based on Linux).
Today: Linux is everywhere โ from your phone and computer to big servers and even space missions. People keep improving it together.
๐ง What is Linux?
Linux is the core of many operating systems. It's open-source, meaning anyone can see, change, and share its code. Imagine it as a super customizable, reliable engine that powers servers, desktops, and even smartphones.
Why is Linux awesome?
Stable: Rarely crashes.
Secure: Hard to hack.
Flexible: Customize it to your liking.
In a nutshell, Linux gives you control and reliability. ๐ ๏ธ
Key Parts of Linux:
Applications: Tools like web browsers and games.
Shell: A translator that executes your commands. Bash is a popular one.
Kernel: The brain managing resources.
Hardware: Physical components like the hard drive and CPU.
๐ Basic Linux Commands
File Commands:
Create a New File:
touch filename
Example:
touch myfile.txt
Copy a File:
cp source file destination
Example:
cp file1.txt /path/to/destination
Move/Rename a File:
mv oldfilename newfilename
Example:
mv oldfile.txt newfile.txt
Remove/Delete a File:
rm filename
Example:
rm unwantedfile.txt
View Contents of a File:
cat filename
Example:
cat myfile.txt
Edit a File:
nano filename
Example:
nano myfile.txt
Directory Commands:
Create a New Directory:
mkdir directoryname
Example:
mkdir mydirectory
Navigate to a Directory:
cd directoryname
Example:
cd mydirectory
List Files and Directories:
ls
Example:
ls
List All Files and Directories (Including Hidden):
ls -a
Example:
ls -a
Copy a Directory and its Contents:
cp -r sourcedirectory destination
Example:
cp -r dir1 /path/to/destination
Move/Rename a Directory:
mv olddirectory newdirectory
Example:
mv olddir newdir
Remove/Delete an Empty Directory:
rmdir directoryname
Example:
rmdir emptydir
Remove/Delete a Directory and its Contents:
rm -r directoryname
Example:
rm -r unwanteddir
Check Your Present Working Directory:
The
pwd
command allows you to identify the current directory you are working in. Simply typepwd
and press Enter to display the full path.$ pwd /home/username/documents
List All Files and Directories (Including Hidden Ones):
To list all files and directories in your current location, use the
ls
command. Adding the-a
flag displays hidden files as well.$ ls -a . .. file1.txt file2.txt .hidden_directory
The
.
and..
entries represent the current and parent directories, respectively.Create a Nested Directory:
Building a nested directory structure is straightforward with the
mkdir
command. For example, to create a nested directory path A/B/C/D/E, use the following command:$ mkdir -p A/B/C/D/E
The
-p
flag ensures that parent directories are created if they don't exist.
Happy Learning ๐!