top of page

Five Linux Commands You Should Know as a Programmer

Introduction


While you may be familiar the more typical terminal commands, this article will shed some light on the more lesser known, but equally practical, Linux utilities.


Here are five commands you should know.


Commands to Know


  • rmdir [parameters] [directory name]

    • remove directory (or directories)

    • deletes the specified directory only if it is empty

    • ex:

      • rmdir directory1 directory2

    • if you need to remove non-empty directories, use the rm -rf [directory name] command to recursively delete all files within that directory without a confirmation message


  • cat [parameters] [directory name]

    • concatenate

    • displays the contents of specified file(s)

    • ex:

      • cat hello.txt

        • this would output whatever is written in the file hello.txt to the terminal


  • man [parameters] [command name]

    • manual

    • displays the documentation of the specifies command

      • each manual page includes the following categories: name, synopsis, description, options, examples

    • ex:

      • man ls

      • man -k cd

        • in this case, the parameter -k searches for all occurrences of the phrase "cd" (like cd-it8) and displays their respective manual pages


  • diff [parameters] [filename]

    • difference

    • compares contents of two files

    • ex:

      • diff file1.txt file2.txt

*The line differentiates between the two files compared, and the numbers and letters indicate which lines are being compared


  • sudo

    • super user do

    • similar to "run as administrator" in Windows systems

    • can be applied to commands that may require special "admin" privileges that may have large consequences on system configuration

    • ex:

      • sudo chmod 646 file.txt

      • sudo apt install [package name]


Final Thoughts


Hopefully you found at least one of these Linux commands useful and feel confident enough to test it out in your own IDE.


If you're interested in more commands like these, check out my blog on similar Advanced Linux Command Line Utilities!


As always, thanks for reading!

Comments


bottom of page