Analysts let loose on the server for the first time.
Students developing operational habits.
Maybe you’re an analyst who’s been given credentials to where the data scientists run their scripts. Or maybe it’s the first day of classes, and you’ve been given credentials to the homework server.
Ok, now what?
If this is your first time using the command line, it can feel meaningless or even disquieting to look at that blinking cursor without context. Here’s some:
Get Situational Awareness
I’ve written elsewhere on this blog about how important situational awareness is when dealing with data. Let’s apply those same principles:
Odds are, you’re on someone else’s computer, and it’s a Linux machine. Linux is an open-source operating system. You can think of it as a third OS, like the cousin to Microsoft Windows, or MacOS.
Think of servers as large, often shared, computers. Maybe it’s “in the cloud.” You’re probably accessing it remotely, and not walking up to an oversize computer and desk chair.
But where am I? Linux, like Windows or MacOS, has folders and directories, like Desktop, or your Downloads folder. When you first log in, you’re by default in your home directory. What’s that? To find out, enter
pwd returns where we are right now.
cd lets you move around:
pwd confirms this as well:
We know where we are, but we can’t see anything. What’s here? Enter
man ls for helpful flags you can add.
ls -alh returns something quite different! Try it yourself.
Another neat command you can use to investigate your surrounds is
Maybe you’re investigating some logs or processes. What time is it? I mean, what time is it on this computer? Timezones and time discrepancies can be a nightmare. Simple – enter
This can be super important for communicating with others about things happening on the server. Observe the timezone. Shared computers, like AWS EC2 servers, often default to UTC, instead of local timezone.
If you’re an analyst that cares about logs on a shared server, there’s a good chance you’re in the unenviable position of investigating
crontab runs. I won’t deepdive that here – check out this intro.
crontab -l will show what cron schedules exist, if any.
If you’re on a shared computer, it can be tough to tell who’s doing what right now. That gets into more advanced topics, but
htop can provide insight into what’s happening on that computer right now:
Congrats! You’re on a linux server. You can get situational awareness quickly by finding out Where (
cd), What (
tree), When (
crontab), and even a little bit of Who (