Welcome to the next part of linux basic commands.
In case you have missed the previous post, or need a quick review on where we started, here is the link.
Continuing from the last post in Basic linux commands series, I am going to mention the most commonly used commands by a Linux BEGINNER.
Changing the hostname
#hostnamectl set-hostname yourhostname.domain
The hostname can be with or without domain name.
Checking OS details
In systems based on redhat , this command will show you the OS, kernel, vendor details.
Configuring date and time
This command shows you the date and time currently in your OS.
It provides more details on the timezone and the NTP status.
#timedatectl set-time 12:00
the above command will change the time to 12 o clock.
#timedatectl set-time 2018-07-01
This changes the date to 7th of july 2018.
Note that the command to change date and time is same. And the syntax for date and time should be strictly followed to avoid the errors.
Shows the kernel name.
Shows kernel name, version, architecture and other details.
Current directory name
Prints the current working directory on screen. In other words shows your current location in directory hierarchy.
#shutdown -h 12:00
The system will shutdown at 12’o clock.
#shutdown -h now
The system will shutdown instantly.
Power off and reboot
powers off the OS.
reboots the system.
You may wonder what is the difference between “shutdown and poweroff”, the first one is a systematic process whereas the later powers off the OS without closing any running programs or saving changes.
Other useful Linux basic commands
Shows the name of user logged in that terminal first.
Shows last successful login attempts of all user accounts.
Gives the list of accounts which failed the login.
displays the name of current terminal.
switches to the user account mentioned in place of “username”.
These linux basic commands are good to start with , if you further want to explore then you can use this site link.