Ubuntu useful Commands
Ubuntu’s world greets you and is ready to provide you complete control over your system. However, as a novice, you may find the Command Line Interface (CLI) frightening. Many individuals perceive Linux to be more difficult to use as an operating system, especially if they are used to Windows or macOS.
Commands used for system information
date
“date” is a basic command that displays the current date and time.
TZ
The time zone provided in the path “/etc/localtime” is used by default by the “date” command. The Terminal command “TZ” can be used to alter the time zone for Linux users.
$ TZ=GMT date
The current date and time of the system can be manually set in Linux.
$ date –set=”20220104 20:29”
df
The programme “df” displays the amount of disc space utilised and available on each file system, as well as the name and path of each file system.
$ df
The command “df -h” produces the same results as “df,” but the data is now in a more human-readable format that a new user may understand.
$ df-h
free
The “free” command displays the total amount of free and utilised memory in the system.
$ free
Uptime
In one line, the command “uptime” gives you information about how long the system has been running.
$ uptime
Passwd
The command “passwd” stands for password and is used to modify a user’s password.
$ passwd username
Exit
The command “exit” is used to exit the system and log out of the current user, as the name implies.
$ exit
Shutdown
Shutting down the system is done with the “shutdown” command.
$ shutdown
Use shutdown -c to cancel the command
mkdir
Users can create directories and folders on the system using the command “mkdir.” To create a directory, the user using this command must have appropriate permissions over the parent directory; otherwise, an error will occur.
$ mkdir ubuntu
To remove files from a directory, use the “rm” command.
$ rm empty_file
MV
The command “mv” has two functions.
To relocate files or folders in the system from one location to another.
To change the name of a file or folder.
$ mv dir1 dir2 # mv to move files $ mv dir dir # mv to rename file
CP
To copy data from a source file to a destination file, use the “cp” command.
$ cp file file_copy
Tail
The “tail” command publishes the last N rows of data from the specified input or file. It prints the last 10 lines of the selected files by default.
$ tail -f /var/log/syslog
Sudo
The command “sudo -I” is used to keep the session running as a root user, which has far greater rights than a regular system user.
$ sudo apt update
Cd
The command “cd” stands for change directory and it is used to change the current directory user is operating in via Terminal.
$ cd /etc/
pwd
The command “pwd” in Terminal displays the path to the current directory in which the user is working.
$ pwd
Reading your article helped me a lot and I agree with you. But I still have some doubts, can you clarify for me? I’ll keep an eye out for your answers.
Reading your article helped me a lot and I agree with you. But I still have some doubts, can you clarify for me? I’ll keep an eye out for your answers.
Nice post. I learn something totally new and challenging on websites
You’re so awesome! I don’t believe I have read a single thing like that before. So great to find someone with some original thoughts on this topic. Really.. thank you for starting this up. This website is something that is needed on the internet, someone with a little originality!
Cool that really helps, thank you.
Hi there to all, for the reason that I am genuinely keen of reading this website’s post to be updated on a regular basis. It carries pleasant stuff.
Cool that really helps, thank you.
Great information shared.. really enjoyed reading this post thank you author for sharing this post .. appreciated
very informative articles or reviews at this time.