useful unix commands
Share
A Unix shell provides a text-based user interface for Unix-like operating systems. The shell is both an interactive command language and a scripting language, and it is used by the operating system to control the execution of the system using shell scripts.
This tutorial will walk you through some Unix shell commands that will be useful to know as you progress on your coding journey. This guide is not an exhaustive list.
how to execute a unix shell command
A Unix shell command can be executed through a CLI application running a Unix shell instance, or it can be executed as part of a Unix shell script.
Once you have opened a CLI application, type the command into the console and press ENTER
or RETURN
to execute it.
Some commands will print text as a part of their execution, and some will not.
An error message will usually be printed if something has gone wrong during the program execution or if the command and its arguments were not structured properly.
Additional information about CLI applications can be found in the
software for unix guide.
Additional information about creating, writing, and executing shell scripts can be found in the unix shell scripts guide.
unix shell shortcuts
Use the TAB
key to autocomplete file, directory, and command names.
Use the UP
arrow key to scroll through previous commands.
Use the DOWN
arrow key to scroll forward through previous commands.
commands
print working directory
pwd
The pwd
command prints the absolute file path of your current location in the shell. Your current location will correspond to some folder in your computer's file system.