Tips & Tricks: Linux OS Edition

George Jon

George Jon

In this edition of the George Jon’s Tips & Tricks Blog series, we will be pivoting our focus to the Linux Operating System. Given that Linux can only (with few exceptions) be accessed via a terminal, many engineers shy away from and/or are intimidated by it. That need not be the case as the following writeup will provide you with some basic commands to help navigate and ultimately, utilize Linux.

The vast majority of commands need to be ran as root. However, just as running as a local administrator is not recommended for Window Operating Systems, neither is logging in and using the root user is not a best practice for Linux. Here’s where the Super User DO or “sudo” command comes in handy…

  • “$sudo” allows you to run commands with the permissions of another user such as, root
  • In the example below, the user ‘dslauter’ created the folder “coolfolder” utilizing sudo

  • “vi” allows you to create and/or edit a file (simple, straightforward text editor)

  • To edit the file, open it, press “I” and you will be directed to insert mode

  • Once you are done editing, press “Esc” to exit Insert Mode and then type “:wq” to write and quit access to the file

  • “$cat filename” allows you to view the contents of a file

  • “top” will show you top running processes and how much cpu/memory utilization

  • “iotop” will show you disk activity

  • “sar” will show you performance history

  • “ls” allows you to view the contents of a directory, which is essentially the same as “dir” for windows

  • “ls -lash” gives you additional info such as permissions, size, and hidden files

  • “rm filename” and rm -r foldername allows you to delete files and folders respectively (-r stands for recursive, so be very careful!)
  • “df -h” to view drive space

  • “du -sh foldername” allows you to view the size of all files/folders inside your current folder (single folder)

  • “du -sh *” allows you to view the size of all files and folders in your current directory

  • “grep” allows you to search a file for a specific word like “error.” Use the cat command and pipe it to grep
  • The example below captures “cat’ing” a log file for errors. This will show you every line that contains the word error

By leveraging and internalizing the simple commands detailed above, you will now have a solid foundation from which to navigate and utilize the Linux Operation System moving forward.

Written by:

George Jon

George Jon on:

Reporters on Deadline

"My best business intelligence, in one easy email…"

Your first step to building a free, personalized, morning email brief covering pertinent authors and topics on JD Supra:
*By using the service, you signify your acceptance of JD Supra's Privacy Policy.
Custom Email Digest
- hide
- hide

This website uses cookies to improve user experience, track anonymous site usage, store authorization tokens and permit sharing on social media networks. By continuing to browse this website you accept the use of cookies. Click here to read more about how we use cookies.