Turn on CENTOS7 virtual machine
To login as Superuser click on not listed >>> enter username:root enter password:xxxxxx >>> login
Open terminal
If you did not set hostname. Set it with the following command.
hostnamectl set-hostname centosbox
bash
Verify hostname
To clear screen: Ctrl+l
To switch from GUI to CLI and CLI to GUI: Ctrl+Alt+F1 .......Ctrl+Alt+F8
$ symbol indicates Normal user
' # symbol indicates root user
[user @ hostname ~]
~ symbol indicates User's home directory
' user@hostname
Terminal shortcuts:
Key | Function |
ctrl+shift++++ | Zoom in |
ctrl-- | Zoom out |
ctrl+shift+t | To open New tab |
ctrl+shift+w | To close tab |
ctrl+shift+n | To open new terminal |
ctrl+shift+q | To close terminal |
Basic Commands
Calendar
cal
To see particular year calendar
cal 2023
To clear screen (Ctrl+l)
clear
who: It prints who currently logged in.
who
To check user, who logged in
whoami
To check user login terminal
who am i
w
Observe difference between who, who am i, whoami and w
To see executed command history
history
To clear entire executed command history
history -c
To switch GUI to CLI
chvt 2
To switch CLI to GUI
chvt 1
To shutdown
sudo shutdown
To reboot
sudo reboot
To restart
init 6
To turnoff
inint 0