Skip to main content

Command Palette

Search for a command to run...

Linux Basic Commands

Essential Commands to Get Started with Linux

Updated
โ€ข3 min read
Linux Basic Commands
N

-> I'm an enthusiastic DevOps professional with over 3+ years of hands-on expertise in cloud infrastructure management and orchestrating the deployment of applications which are ready for production. -> Excellent problem-solving skills and a proactive learner, staying updated with the latest trends in DevOps and Cloud Computing. ๐†๐ž๐ญ ๐ข๐ง ๐“๐จ๐ฎ๐œ๐ก -> ๐‚๐จ๐ง๐ง๐ž๐œ๐ญ ๐จ๐ง ๐‹๐ข๐ง๐ค๐ž๐๐ข๐ง : If you're interested in engaging in technical discussions or connecting professionally, please feel free to connect with me on LinkedIn. -> ๐„๐ฆ๐š๐ข๐ฅ : ncpr.0912@gmail.com

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.