Basic Linux TutorialIntroduction – What is it? Why to learn? Linux installation directory structures Boot process Run levels in Linux Desktop Environments Different shells BASH Internal and External Commands Basic Linux Commands Important files and directories in Linux Environmental and Shell Variables Command history in Linux Character classes in Linux Text editors vim nano Searching files Creating new files Viewing File Contents File commands File permissions and ownership WildCards (Globbing) in files File compression Directory commands xargs command in Linux Comparing files Searching patterns using grep command Translating the characters using tr command Extracting data using cut command Stream editing using sed command Data extraction and reporting using awk command Sorting the file or string input uniq command in Linux Difference between grep, tr, cut, sed and awk commands Hardware commands Hard disk and memory space commands Working with Processes Managing Jobs Working with cron jobs Service command in Linux Network commands Managing Users and Groups Other Popular commands Standard streams and Redirection Pipes Package Managers in Linux
System commands in linux shellBelow is the list of commands to get information about system and hardware.
- free – used to display memory information
- cat /proc/meminfo – memory information
- fdisk – hard drive partition information
- du – prints information about the disk usage
- df – information about free disk space in given directory
- lscpu – details about cpu
- cat /proc/cpuinfo – cpu information
- uname -a – Prints details of the operating system
- last reboot – prints the time when system was last time rebooted
- init 0/ shutdown -h – shutdown the system
- reboot/init 6/ shutdown -r now – command to restart the system
uptime commanduptime command is used to display current time, the duration of time for which system is running, how many users are currently logged into the system. It also displays the average load on the system.
shutdown commandshutdown command is used to shut down the system. Here -h means halt.
If you want to shut down the system after 5 minutes, you can use below command.
$ shutdown -h now
If you want to reboot the system, you can use below command. Here -r means reboot.
# shutdown -h +5
# shutdown -r now
Web development and Automation testing