Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
2 views5 pages

Basic Windows and Linux Commands

guy8o6do8

Uploaded by

thailandjunior98
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)
2 views5 pages

Basic Windows and Linux Commands

guy8o6do8

Uploaded by

thailandjunior98
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/ 5

Basic Windows and Linux Commands

Task Window Example Linux Example (Linux) Application /


s (Windows) Comma Use
Comma nd
nd
Show dir dir ls ls /home/student Lists files and
C:\Users\Stu
current folders in the
dent
directory specified
contents directory
Change cd cd cd cd Documents/Lab1 Navigate to a
Desktop\Lab1
directory different
directory
Show cd (with cd → outputs pwd pwd → Displays where
current no current folder /home/student/Des you are in the
directory ktop file system
argumen
(path) t)
Create a mkdir mkdir mkdir mkdir Projects Creates a new
Projects
new folder
directory
Create a echo echo Hello > touch touch hello.txt Creates a new
hello.txt
new file empty file (or
writes text in
Windows
example)
View type type cat cat hello.txt Displays the
hello.txt
contents of text inside a file
a file
Copy a file copy copy cp cp hello.txt Makes a
hello.txt backup.txt
duplicate of a
backup.txt
file
Move/Rena move move mv mv hello.txt Moves or
hello.txt Documents/
me a file renames a
Documents\
file/directory
Delete a del del rm rm hello.txt Removes a file
hello.txt
file permanently
Delete a rmdir rmdir rmdir rm -r OldFiles Removes an
OldFiles (empty)
directory empty or full
or rm -r directory
(non-
empty)
Clear the cls cls clear clear Clears the
screen command/termi
nal screen
Display tasklis tasklist ps or ps aux / top Shows all
t top
running active
processes processes
Terminate taskkil taskkill /IM kill kill -9 1234 Stops a
l notepad.exe (1234 = PID)
a process program or
/F
process
Show ipconfi ipconfig ifconfi ifconfig or ip Displays IP
g /all g or ip addr
network addresses and
configurati network details
on
Test ping ping ping ping google.com Tests
www.google.c
network om
connectivity to
connection another
device/website
Check date date & date /t and date date Displays or sets
and time time time /t the system
date/time
Show help command dir /? man man ls Shows
/?
for a documentation/
command help for a
command

Key Takeaway for Students

• Windows commands usually follow command [options], while Linux commands often
follow command [options] [file].
• Linux provides more flexibility and scripting capabilities, while Windows focuses on
simplicity and compatibility.
• Many tasks can be performed in both OSes using slightly different command names.

Prac�cal Exercise: Exploring Basic Windows and Linux Commands

Part A: Windows Command Prompt

Task 1: File and Folder Opera�ons

1. Open Command Prompt (Win + R → type cmd → Enter).

2. Navigate to the Desktop:

o cd Desktop

3. Create a new folder named Prac�ce:

o mkdir Prac�ce
4. Move into the folder:

o cd Prac�ce

5. Create a file named hello.txt containing the text Hello World:

o echo Hello World > hello.txt

6. Display its contents:

o type hello.txt

7. Copy the file into another file named backup.txt:

o copy hello.txt backup.txt

8. Delete the backup file:

o del backup.txt

Expected Output: Students should see “Hello World” displayed and confirm that only hello.txt
remains.

Task 2: System Commands

1. Check your current working directory:

o cd

2. View running processes:

o tasklist

3. Kill Notepad (open Notepad first, then run):

o taskkill /IM notepad.exe /F

4. View network configura�on:

o ipconfig /all

5. Test internet connec�vity with Google:

o ping www.google.com

Expected Output: Students should be able to list processes, terminate one, and confirm
successful ping replies.
Part B: Linux Terminal

Task 1: File and Folder Opera�ons

1. Open Terminal (Ctrl + Alt + T in Ubuntu).

2. Navigate to the Desktop:

o cd ~/Desktop

3. Create a folder named Prac�ce:

o mkdir Prac�ce

4. Move into the folder:

o cd Prac�ce

5. Create an empty file called hello.txt:

o touch hello.txt

6. Open and edit it to contain Hello World:

o nano hello.txt (type text, then Ctrl + O to save, Ctrl + X to exit)

7. Display its contents:

o cat hello.txt

8. Copy the file into another named backup.txt:

o cp hello.txt backup.txt

9. Delete the backup file:

o rm backup.txt

Expected Output: Students should see “Hello World” displayed and only hello.txt in the folder.

Task 2: System Commands

1. Show your current directory:

o pwd

2. List all running processes:

o ps aux

3. Kill a process (find PID first, then run):


o kill -9 <PID>

4. Display network configura�on:

o ifconfig or ip addr

5. Test connec�vity to Google:

o ping google.com

Expected Output: Students will see the PID list, be able to terminate a process, and confirm
successful ping replies.

Part C: Reflec�on Ques�ons

1. What are the differences in how Windows and Linux represent file paths?

2. Which system provides more detailed process informa�on by default?

3. How do you create and view a text file in Windows vs Linux?

4. Why do you think Linux enforces file permissions more strictly than Windows?

5. Which environment (Windows or Linux) do you find easier for command-line tasks, and
why?

You might also like