Bash Commands

There is an unspoken rule when it comes to learning how to use Linux that you are not a true user until you learn the basics of bash commands. While there are some great GUI applications that can help you work in Linux, bash commands are essential. They can be everything when nothing else works. Over the last few years, my knowledge of Linux has expanded as I tend to run a dual-boot environment on my computers. I’ve used Linux for everything from gaming, to Android development, to penetration testing.

Over numerous years and numerous Linux distributions, I have come to learn the importance of bash commands. Across distributions and versions, it is the one constant. Whether you use Linux at home, or are looking into work that requires knowledge of Linux command line, here are some of the top bash commands every Linux user should know. Of course, the command line doesn’t have to be all business all the time. Check out my other Linux command line post to see some fun things you can do in the terminal.

Basic Bash Commands

sudoRuns commands as root. This means no limitations of permissions. Can only be used when an account has been configured for root access, such as an administrator.

cdChanges the current working directory.

lsLists the contents of a specific directory. If no directory is specified it lists the contents of the current working directory.

killTerminates the process specified in the arguments. Think of it as the “End Task” for Linux.

nanoOpens files in a very basic command terminal text editor.

nano bash text editor

Example of the Nano bash text editor.

System Information Bash Commands

psDisplays information about all of the processes currently running on the machine.

dfDisplays disk usage for the filesystem.

hostnameDisplays the name of the current host system.

uptimeShows how long the system has been running since the last reboot.


Various System Information Bash Commands

Networking Bash Commands

ifconfigDisplays information about network interfaces, their state, IP address, packet count, and more.

tracerouteAttempts to provide information about the routers your connection crosses when reaching a remote machine.

netstatGives information about ongoing connections on the local system and what ports are listening.

curl ifconfig.meShows the machines external IP address. Like using WhatIsMyIp in the terminal.


Example output from netstat bash command.

File Manipulation Bash Commands

chmod or chownAllows for changing file permissions and owners.

grepSearches through specified file location for files that contain a specified string in the arguments.

mkdirCreates a new directory or rmdir removes a directory.

cpCopies files or directories to a new location or mv moves files to a different directory.

touchCreates a new file in the current working directory.

ddConvert and copy a file.


Grep bash command arguments and parameters.

Miscellaneous Bash Commands

manGiving another bash command as an argument, man (short for manual) gives more details about the command you are trying to use.

clearClears the terminal and resets the prompt to the top line. Very useful when the terminal screen becomes clogged.

mount / unmountUsed to mount filesystems. Particularly useful for SD Cards, USB drives, and external optical and storage drives.

passwdAs you might have guessed, this command allows you to change your user password.

historyLists previous bash commands for the current shell session.


Man bash command showing options for “touch” command.


There you have it. The most basic bash commands that every Linux user should know. What do you think should be added to the list? What are your highest used bash commands? Let me know in the comments below!

Spread the love
Categories: Computer Systems

Johnny T

The socially awkward nerd in the corner. Don't mind me. Even I don't know I'm here. Dad, husband, cancer survivor, IT dude.

Leave a Reply