Windows & Linux Command Line Comparison Side by Side

As a long time Linux user I’ve always wondered what it’s like to use Windows. Whether you’re switching from Windows to Linux or vice versa, this post is here to help you quickly navigate the command line with a side by side comparison between the Linux terminal and the Windows command prompt. This post assumes you have basic knowledge of at least one.

Viewing Contents of a directory

Both Linux and Windows make it easy to see what’s inside a folder. Don’t forget about flags! In Linux you can use flags like -l -i and -a to see hidden files and permissions

Windows

$ dir

Linux

$ ls

Create File

Creating files is another dead simple task in both systems.

Windows

$ echo contents_of_file > file.txt

Linux

$ touch file.txt #for empty file

$ echo “contents of file” > not_empty.txt

Create a Folder / Directory

Creating a directory is super easy in both Linux and Windows on the command lines. In fact… It’s the same!

Windows

$ mkdir folder_name

Linux

$ mkdir folder_name

Heading

Summ

Windows

cmd

Linux

cmd

Change Directories

Probably one of if not the most commonly used command is moving in and out of directories so you can navigate your file system. Windows is WEIRD on this one. The Windows file system uses that “\” slash instead of / but for some reason getting out of directories uses the / So let’s see how it works below:

Windows

$ cd folder\you\want #puts me in want/ folder.

$ cd ../../.. # takes me out

Linux

$ cd folder/you/want

$ cd ../../../ #moves out of a dir

View current directory

I’ve never needed this command but viewing the present working directory can be done by running this:

Windows

$ cd

Linux

$ pwd

Rename a file/folder

Windows

$ rename old_filename new_filename

Linux

$ mv old_filename new_filename

Move a file/folder

Moving stuff around is pretty common, and pretty easy.

Windows

$ move file_to_move location\you\want

Linux

$ mv file.txt where/you/want

That covers most of the commands you’ll want to use in the command line. There’s a quite a few more below that I’ll get to later down the line but that should hopefully get you started.

Coming Soon:

delete file

delete folder

lsblk

mount

df

uname

ps

kill

Shutdown init 0

copy file / folder

cat

head / tail

copy

less / grep / awk

curl

find

grep

sed

echo

clear

sudo

chmod chown

man tar make

Leave a Comment

Your email address will not be published. Required fields are marked *

want more details?

Fill in your details and we'll be in touch

%d bloggers like this: