Bash Commands All Linux Users Should Know
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
sudo – Runs 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.
cd – Changes the current working directory.
ls – Lists the contents of a specific directory. If no directory is specified it lists the contents of the current working directory.
kill – Terminates the process specified in the arguments. Think of it as the “End Task” for Linux.
nano – Opens files in a very basic command terminal text editor.
System Information Bash Commands
ps – Displays information about all of the processes currently running on the machine.
df – Displays disk usage for the filesystem.
hostname – Displays the name of the current host system.
uptime – Shows how long the system has been running since the last reboot.
Networking Bash Commands
ifconfig – Displays information about network interfaces, their state, IP address, packet count, and more.
traceroute – Attempts to provide information about the routers your connection crosses when reaching a remote machine.
netstat – Gives information about ongoing connections on the local system and what ports are listening.
curl ifconfig.me – Shows the machines external IP address. Like using WhatIsMyIp in the terminal.
File Manipulation Bash Commands
chmod or chown – Allows for changing file permissions and owners.
grep – Searches through specified file location for files that contain a specified string in the arguments.
mkdir – Creates a new directory or rmdir removes a directory.
cp – Copies files or directories to a new location or mv moves files to a different directory.
touch – Creates a new file in the current working directory.
dd – Convert and copy a file.
Miscellaneous Bash Commands
man – Giving another bash command as an argument, man (short for manual) gives more details about the command you are trying to use.
clear – Clears the terminal and resets the prompt to the top line. Very useful when the terminal screen becomes clogged.
mount / unmount – Used to mount filesystems. Particularly useful for SD Cards, USB drives, and external optical and storage drives.
passwd – As you might have guessed, this command allows you to change your user password.
history – Lists previous bash commands for the current shell session.
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!