Ubuntu Commands list for beginners

Ubuntu commands list

In this guide, we have made a list of the best Linux Ubuntu commands for beginners. Without Ubuntu commands, you cannot operate the terminal of Ubuntu. To use the Ubuntu terminal like a pro, you must read these Ubuntu commands.

But before getting into the Ubuntu command. I want you to know about the Ubuntu terminal and the uses of Ubuntu terminal commands.

We all know that Ubuntu is a widely used open-source operating system for the Linux platform. And its command-line interface or a Terminal is a necessary part of the Ubuntu operating system.

Using Ubuntu commands in Terminal is an efficient way to get the actual power of a computer that is better and faster than a graphical interface.

You can use the Ubuntu terminal to run various programs, execute several files, navigate to folders, and many more.

To take benefit of the Ubuntu terminal, You must know some basic Ubuntu commands. These Ubuntu commands can be useful for any beginner. Here we have made a list of basic commands that can be used in Ubuntu Terminal.

Ubuntu commands list and cheats sheet

1. Sudo

Sudo stands for SuperUser DO. It is used to perform restricted operations. In Linux, normal users cannot access some parts or files of the system.

The Sudo command allows users to complete the restricted operations without logging in as a superuser. In simple words, Sudo allows you to run any command with superuser privileges.

sudo [command]

Replace [command] with your command.

2. ls

ls is a basic Linux Ubuntu command used to list files and directories. The command comes with so many features like you can check hidden files and directories, permissions, and many more things. Here are the uses of the ls command:

  • ls show you a list of files and directories;
  • ls -l long list format with extended information;
  • ls -a show you hidden files and folders;
  • ls -h shows a list along with the size of files and directories.
Example of ls command:

ls -lha

The above command will show you a list of files and folders along with hidden files and their size.

3. Cd

cd stands for change directory. It is used to navigate from one directory to another. In simple words, the cd command allows the user to change the directory. It is the most important and widely used Ubuntu command. The use of this command as follows:

  • cd ~ leads you to the home directory;
  • cd / leads you to the root directory;
  • cd ..  leads you up one directory level;
  • cd - leads you to the previous directory;
Example of Cd command:

To move from root to the download folder following command will be used.

cd Downloads

4. Cp

cp stands for the copy. This command is used to copy files, groups of files, or directory from one destination to another. 

To use this command, type the filename and the location where you want to copy that specific file. 

For example:

cp ABC /root/Downloads/

The above command will copy the ABC file to the Downloads folder.

5. Mv

mv stands for the move. This Ubuntu command is used to move one or more files or directory from one place to another. The usage of this command is the same as the cp command, Just use mv instead of cp to use this command.

Syntax: mv

6. Rm

The rm command is mainly used to delete the files or directories. The uses of this command are shown below:

  • rm <filename> remove a file;
  • rm -r <directory name> remove directories and their contents recursively;
  • rm -rf < directory name> remove directories and their contents forcefully;
  • rm -rf * remove everything forcefully present inside the directory.
Note: Don't run rm -rf * command in the root directory. 

7. Rmdir

rmdir command allows you to delete an empty directory. This command is of no use, You can use the rm -r command to remove the directory along with its content.

Syntax: rmdir

8. Mkdir

The use of the mkdir command is to create directories. For example, mkdir Ubuntu will create a directory named Ubuntu.

Syntax: mkdir

9. History

history command shows a list of all previously typed commands. You can also clear the history of your previously typed command by using history -c.

Syntax: history

10. Pwd

pwd stands for print working directory. It prints the path of the directory in which you are present.

Syntax: pwd

11. Clear

Clear command is used to clear the screen of the terminal. Simply type clear to clear the terminal screen.

Syntax: clear

12. Date

use this command to display the current date and time. This command allows the user to print the current date and time on the Ubuntu terminal.

Syntax: date

13. Cal

This command allows the user to display a calendar on the terminal.

Syntax: cal

14. Cat

Cat stands for concatenate. It is a widely used command in Linux distributions, especially in Ubuntu. Cat command helps users to create, view the content of the files.

  • cat <filename> To view the content of the file;
  • cat >Ubuntu It will create a file named Ubuntu.
Syntax: cat

replace <filename> with the name of the file that you want to view.

15. Uname -a

uname -a used to display information about the system on the terminal screen. Use this command to see the architecture, Version, etc. of your Ubuntu system.

  • uname -a prints all information about the system;
  • uname -s Prints kernel name on the terminal screen;
  • uname -n shows the hostname of your computer;
  • uname -m shows the hardware architecture of your computer;
  • uname -o shows the name of your operating system;
  • uname -v shows the version information.
Syntax: uname

16. Passwd

passwd is the most important command of Ubuntu. It is used to change the password of a user account. Only the root user has permission to change the password of any user. Normal user can change the password of his/her own account.

For example:

passwd [username]

Syntax: passwd

Replace the [username] with your username.

17. Apt-get

Apt stands for advanced packaging tool. apt-get is the most useful command in Ubuntu Linux. It is mainly used to install, remove, update, upgrade the package, and repository.

Its main task is to retrieve the data and packages from the verified sources for the repository. It has the ability to upgrade and remove the packages along with their dependencies.

The usage of this command as follows:

  • apt-get update. This command is used to update the system repository. You always have to use this command before performing an upgrade or dist upgrade.

apt-get update

  • apt-get upgrade. Use this command to upgrade the packages that are currently installed in your system. The packages that are present in sources. list repository will be upgraded. You must always use the update command before upgrading your system. The update command will get the latest version of packages and the upgrade command will upgrade those packages.

apt-get upgrade

  • apt-get dist-upgrade. Use this command to upgrade your packages. This command also handles dependencies with new versions of packages. Running this command may remove some old packages.

apt-get dist-upgrade

  • apt-get install [package name]. This command is used to install or upgrade the packages.

apt-get install [package name]

  • apt-get remove [package name]. Use this Ubuntu command to remove the packages. It does not remove any files that are created by a package.

apt-get remove [package name]

  • apt-get purge [package name]. The use of this command is to remove the packages along with the configuration files associated with the packages.

apt-get purge [package name]

18. Whatis

Whatis command is used to get brief information about the Linux commands and its functions.

Examples of whatis command:

whatis dpkg

whatis zip

whatis cat

Syntax: whatis [package name]

19. Zip

Zip command is used to compress the file in .zip extension. Zip can reduce file size up to 62 percent by compressing it into the .zip format.

zip ubuntu.zip ubuntu.txt

The above command will compress ubuntu.txt into ubuntu.zip.

Now let's see how you will unzip this. To unzip ubuntu.zip into ubuntu.txt following command will be used:

unzip ubuntu.zip

20. Uptime

Use this command to see the uptime of your machine. In simple words, It is used to find out how long the system is active, It also includes the current time, the number of users logged on to the machine, and load average.

Syntax: uptime

21. Df

df stands for disk free. df command is used to display total space along with available space in the file system.

Syntax: df

Related Articles:


So Above is the list of best Ubuntu commands for beginners. You must learn all these commands to properly run Ubuntu without having any problem. If you think that we had missed any important command then let us know in the comment section. I hope this article is helpful to you.

Post a Comment

Previous Post Next Post