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
Creating files is another dead simple task in both systems.
$ echo contents_of_file > file.txt
$ 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!
$ mkdir folder_name
$ mkdir folder_name
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:
$ cd folder\you\want #puts me in want/ folder.
$ cd ../../.. # takes me out
$ 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:
Rename a file/folder
$ rename old_filename new_filename
$ mv old_filename new_filename
Move a file/folder
Moving stuff around is pretty common, and pretty easy.
$ move file_to_move location\you\want
$ 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.
Shutdown init 0
copy file / folder
head / tail
less / grep / awk
man tar make