Tips & Tricks: Linux OS Edition

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.

Contact Us to Learn More!

If you found this information helpful and would like to tap into George Jon’s wealth of knowledge and experience, please contact us for a consultation. Our Subject Matter Experts (SMEs) are standing by, and we welcome the opportunity to optimize your eDiscovery / Forensic environment capabilities and performance.