Linux Basic Commands

Linux Basic Commands

ยท

3 min read

Introduction

  • Linux commands are instructions you type into the terminal to make the operating system do things.

  • Remember, in Linux, uppercase and lowercase letters matter in commands.

  • You can do lots of stuff with Linux commands, like managing files, networking, handling processes, and managing users.

  • Many Linux commands are similar to ones used in Unix, with over 100 commands in common.

  • Experienced users can customize Linux commands for advanced tasks.

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

  • Learning basic Linux commands is important for using the system smoothly.

  • These commands help you handle files, folders, and other tasks easily.

  • Once you know these basics, you'll find it easier to explore advanced Linux features.

  • Practice using these commands regularly to get better at using Linux.

  • Embrace the command line as a handy tool for getting things done quickly on Linux.

Did you find this article valuable?

Support Chandra Prakash Reddy by becoming a sponsor. Any amount is appreciated!

ย