This document provides a list of basic Linux commands organized by function including commands to check system information, navigate and manage files and directories, manage users and groups, shutdown and reboot the system, check disk usage, and edit files. Some key commands are logname to check the current user, ifconfig to view IP address, ls to list directory contents, mkdir to create directories, mv to move or rename files and directories, rm to delete files, and vi to open and edit files.
This document provides a list of basic Linux commands organized by function including commands to check system information, navigate and manage files and directories, manage users and groups, shutdown and reboot the system, check disk usage, and edit files. Some key commands are logname to check the current user, ifconfig to view IP address, ls to list directory contents, mkdir to create directories, mv to move or rename files and directories, rm to delete files, and vi to open and edit files.
# -- System Admin Prompt Commands $ logname (or) whoami --------- To Check Present Working User $ who ---------------------------- To Know Present Working Users $ hostname --------To Know HostName(Machine Name) Of A Server $ ifconfig ---------- To Find an IP $ lscpu ------------- To check CPU architecture $ su [super user name] ---- Switch to Super User $ clear---------- To Clear Screen $ exit ------------To exit From user Session $ man [cmd]----------- Help Facility $ date ----------- To Display date $ cal [month] [year] ----- To Display Calender $ pwd ---------- To Know Present Working Directory $ ls [flags]--------------To Display Directory Content $ mkdir [dir name]---------- To Create New Directory $ cd [dir name] -------------- To Change Directory $ mv [oldname] [newname) -------- To Rename Directory $ rmdir [Directory Name] ---------- To delete directory $ mv [source path] [target path] ---- To Move directory with sub directories $ cp [source path] [target path] ---- To Copy directory with sub directories $ cat > [file name] ----------------- To Create File $ cp [source file] [target file] ------- To Copy A File $ mv [Old File] [New File] --------- To Rename A File $ rm [file name] --------------------- To Remove A File $ locate [file name] ------------------- To Search A file In Whole File System $ find [file name] [path] ---------------- To Search A file in Specified Path $ gzip [file name] ---------------------- To Compress A File $ gunzip [file name] ------------------- To Uncompressed A File $ chmod [777] [file name] ------------- To Change File Permissions $ chown [new owner name] [file name] --- To Change Owner $ chgrp [new group name] [file name] ----- Change Group To A File $ useradd -u [uid] -g [group name] -d [user home dir] -s [shell] - Creating New User $ groupadd -g [group id] [group name] ------ To Create New Group $ userdel [user name] ------ To Delete User $ shutdown [time] -------- To Shutdown System At Particular Time $ shutdown -r now ------------- Shutdown and reboot immediately $ shutdown -h halt -------------- Shutdown immediately and halt $ df/df-k/df -g/df -h ---------- To Check Free Disk Space $ du / du -s [dir name] ------- To Check Used Space $ vi [file name] -------------- To Open a File with VI Editor $ head -n [no of lines] [file name] ---- To Display First N line in A File $ tail -n [no of line] [file name] -------- To Display Last N lines In A File