Basic Ubuntu Commands
If you are Ubuntu newbie, then this post about basic Ubuntu commands is going to help you to get familiar with the Terminal emulator.
![]() |
Ubuntu Terminal |
As we all know, Ubuntu is one of the most customizable Linux distributions today. In fact, when we hear about Linux, the first thing we will become is Ubuntu. Almost every Linux enthusiast starts with Ubuntu when entering the Linux world because Ubuntu is one of the Linux distributions that beginners choose.
- Sudo Command
sudo is a program for Unix-like computer operating systems that allows users to run programs with the security privileges of another user, by default the superuser. It originally stood for "superuser do" as the older versions of sudo were designed to run commands only as of the superuser.
Basic Ubuntu Commands
1. whoami : This command is used to display who is the current logged-on user.
2. pwd : (Present Working Directory)This command will display the current working directory.
3. ./write-ip.sh : The output will be the IP address assigned to the machine as shown
4. rm -r (“remove recursively”) – Removes a directory along with its content.
5.history : command displays all of your previous commands up to the history limit.
6.df (display filesystem) : df command displays information about the disk space usage of all mounted filesystems.
7.du (directory usage) : du command displays the size of a directory and all of its subdirectories.
8. free : Displays the amount of free space available on the system.
9. uname -a : Provides a wide range of basic information about the system.
10. top : Displays the processes using the most system resources at any given time. “q” can be used to exit.
11. info : Similar to man, but often provides more detailed or precise information.
12. echo – Print any text that follows the command
13. less – Linux command to display paged outputs in the terminal
14. uname – Linux command to get basic information about the OS
15. tar – Command to extract and compress files in Linux
Ubuntu Terminal Shortcuts:
To further ease up your skill, these Ubuntu Terminal keyboard shortcuts would help.
Ubuntu Terminal Shortcuts | Function |
---|---|
Ctrl + Shift + T | Open new tab on current terminal |
Ctrl + Shift + W | Close the current tab |
Ctrl + A | Move cursor to beginning of line |
Ctrl + E | Move cursor to end of line |
Ctrl + U | Clears the entire current line |
Ctrl + K | Clears the command from the cursor right |
Ctrl + W | Delete the word before the cursor |
Ctrl + R | Allows you to search your history for commands matching what you have typed |
Ctrl + C | Kill the current process |
Ctrl + Z | Suspend the current process by sending the signal SIGSTOP |
Ctrl + L | Clears the terminal output |
Alt + F | Move forward one word |
Alt + B | Move backward one word |
Ctrl + Shift + C | Copy the highlighted command to the clipboard |
Ctrl + Shift + V or Shift + Insert | Paste the contents of the clipboard |
Up/Down Arrow keys | To scroll through your command history, allowing you to quickly execute the same command multiple times |
TAB | Used to complete the command you are typing. If more than one command is possible, you can press it multiple times to scroll through the possible completions. If a very wide number of commands are possible, it can output a list of all possible completions. |
Comments
Post a Comment