At work, I administrate several Linux systems. That, plus the bundling of the Windows Subsystem for Linux has me in the Linux environment quite a lot. Here is a list of several of my go-to Linux commands:


I use ssh to remotely connect to endpoints that I administrate. A command like:

ssh -i ~/my_key.pem someuser@someendpoint

let’s me use a private key to quickly gain access to a server I need to work on.


Once I connect to a remote system, I often have to upload or download files to the system. The “secure copy” (scp) utility does the trick! To, say, download a log file from a remote system to my workstation for analysis, I can run a command like this:

scp -i ~/my_key.pem someuser@someendpoint:my_app.log ./my_app.log


I often administrate long-running processes, so getting a report of the running processes with the ps command comes in quite handy. Piping that report to grep is even better. Here’s what I do to check for running Python processes:

ps -ef|grep python


Even in this age of disk space abundance, I still have to pay close attention to disk space on the systems I manage (even my own workstations). Command like df and du help in this regard. With df, I’ll run a simple command like this to get a quick snapshot of the space available to the main drives mounted to my system:

df -h

Occasionally, I’ll have one or a few directories or files larger than others that I should focus on for freeing up disk space. The du command helps me drill down to the problem areas with a command like this:

du -h –max-depth=1


Find is a great command for helping me find directories or files that meet certain criteria. Some of the systems I manage write hundreds or thousands of data files to a single directory. I usually archive such data files by month in case I ever need to refer back to them. I’ll use find to find all the files produced in a particular month and pipe those files to a command like tar to archive them. For example, suppose I need to archive all the CSV and TSV files produced in January 2019. I’ll run a command like so:

find .(-name “*.csv” -o -name “*.tsv”) -type f -newermt “2019-01-01” ! -newermt “2019-02-01” -print0|tar -czvf Jan2019.tar.gz –null -T –

For a nice explanation of some of those arguments, check out this article.

Of course, now that I’ve archived those files, I don’t want to leave the originals laying around taking up disk space, so I need to remove them. I will now reuse my find command, this time piping it to xargs and the remove (rm) command:

find .(-name “*.csv” -o -name “*.tsv”) -type f -newermt “2019-01-01” ! -newermt “2019-02-01” -print0|xargs rm


Working with files means creating, copying, moving, renaming, and deleting them…among other tasks. Linux has commands for all these tasks and more with tools like copy (cp), move (mv), remove (rm), and touch–a nice command to quickly create a new, blank file.


There are plenty of tools in Linux for viewing files. For example, cat writes the entire contents of a file to the screen. That’s fine if the file is small, but if it’s large, you might spend the next minute or two watching data fill up and scroll across your screen. If I’m looking for a particular word or phrase, I might pipe cat to grep like so:

cat my_app.log|grep error

I tend to use tail a lot, too, for looking at the last few lines of a log file. With this command, I can look at the last 20 lines of my log file:

tail -20 my_app.log

The great thing now with WSL is that you can use all these powerful Linux commands against your own Windows file system, although Microsoft does caution about getting too crazy with that.

For more interesting actions you can do with Linux commands, check out this article.