Linux Basic Commands

Linux Basic Commands

Essential Commands to Get Started with Linux

ยท

3 min read

Introduction

  • Linux commands are written instructions that you enter into the terminal to control the operation of the operating system.

  • Keep in mind that commands in Linux require both uppercase and lowercase letters.

  • Linux commands cover a wide range of tasks, including file management, networking, process management, and user management.

  • There exist more than 100 commands that are comparable across Unix and Linux.

  • Linux commands can be customized by knowledgeable users for complex operations.

Basic Commands

CommandDescription
manDisplays the manual pages for commands and utilities.
lsLists files and directories in the current directory.
cdChanges the current directory.
dateDisplays or sets the system date and time.
calDisplays a calendar.
clearClears the terminal screen.
whoamiDisplays the current username.
pwdPrints the current working directory.
mkdirCreates a new directory.
touchCreates a new empty file.
echoDisplays text or variables.
catDisplays the contents of a file.
cpCopies files or directories.
mvMoves files or directories or we can rename it as well.
rmRemoves files or directories ( in case we use rm -r ) .
rmdirRemoves an empty directory.
moreDisplays the contents of a file one screen at a time.
lessDisplays the contents of a file, allowing backward movement.
headDisplays the first few lines of a file.
tailDisplays the last few lines of a file.
sudoExecutes a command with superuser privileges.
suSwitches user or runs a command as a different user.
topDisplays real-time system resource usage.
whichShows the full path of shell commands.
dfDisplays disk space usage.
freeDisplays the amount of free and used memory in bytes.
duDisplays disk usage of files and directories.
wgetDownloads files from the internet.
findSearches for files in a directory hierarchy.
aliasCreates shortcuts for commands.
historyDisplays command history.
sortSorts lines of text files.
viOpens the Vi text editor.
lnCreates links between files/directories.
diffCompares files line by line.
wcCounts lines, words, and characters in a file.
uptimeDisplays how long the system has been running.
treeDisplays the contents of directories in a tree-like format.

Conclusion

  • To use Linux smoothly, you should become familiar with its fundamental commands.

  • You may simply manage files, directories, and other operations with the use of these commands.

  • It will be simpler for you to investigate advanced Linux features if you understand these fundamentals.

  • Regular practice with these commands can help you become more proficient with Linux.

  • Accept the command line as a helpful resource for completing tasks fast on Linux.

Did you find this article valuable?

Support DevOps Tour by becoming a sponsor. Any amount is appreciated!

ย