Windows and Unix commands

Profile picture for user Kevin
Kevin Gallagher
Systems Administrator

Let’s take a moment to talk about shell commands. Some of you might remember DOS variants like the popular MS-DOS, so you will be familiar with a CLI (Command Line Interface). People who were born after 1990 probably won’t. I grew up with the Apple IIGS, and the IBM PC in 286 and 386 variations. I fell in love with computing on a 486 DX2 running America Online 3.0 and Windows 95, with a turbo button that could switch from 33 to 66 MHz, and I remember the release of the first Intel Pentium processor. But enough reminiscing. The vast majority of users on recent versions of Microsoft Windows don’t ever need to work with the command prompt, but the functionality is still there, and can be accessed by running cmd.exe.

By contrast, the ability to use a shell is considered a fundamental aspect of knowing how to use the Linux operating system. Even users of Mac OS X, especially software developers, often work with the provided Terminal application. Typically, these Windows commands have less options, and are less powerful than their counterparts, but are easier to use. Many of the Linux commands listed below are referred to as the GNU core utilities.

Altogether, these utilities are the ultimate Swiss Army Knife for file manipulation on operating systems. I’m such an aficionado that, even on Windows, I prefer to have these commands available and in my $PATH, which can be accomplished with Cygwin or GnuWin32. When you find yourself stranded in a land without a GUI or desktop, or trying to recover your crashed computer, it quickly becomes essential for one to know some Unix shell commands or their Windows equivalents. Here are the basics:

Linux Windows Description
ls dir List files and folders in the current working directory.
cd cd Change the current working directory.
cp copy Copy a file or folder to a new location.
mv move / rename Move or rename a file or folder..
mkdir md Make a new folder or subdirectory.
rm del or rmdir Delete a file or folder.
echo echo Send some text to the console screen.
cat type Show the contents of a text-based file.
grep find Locate a text string inside of a file.
more more Show the contents of a text-based file, with scrolling.
df net use Show all storage devices.
uname ver Show information about the operating system or kernel version.
who net session Show all currently logged-in users.
adduser net user Manage user accounts on the system.
useradd net localgroup Manage users and groups.
ping ping Send a ping to a remote host.
ifconfig -a ipconfig /all Show information about network adapters and connections.
traceroute tracert Trace the route of network packets traveling to a remote host.
ftp ftp Transfer files between systems.
telnet telnet Telnet is a remote console program.
nslookup nslookup Perform resolution of a hostname using DNS.
man help Get help or more information about a command.

I hope this post comes in handy. Once you can effectively make your way around a command line interface, then one is truly on the way to becoming a l33t hax0r.