Download This Cheat Sheet To Learn Basic Linux Commands

New to Linux? Learn the basic Linux commands with this cheat sheet

Linux is the flavor for programmers and wannabe hackers today as it is slowly and steadily being adopted for standalone PCs in addition to networked PCs. One of the basic reasons it is so popular among coders and hackers is its rugged command line structure, unlike Windows and Mac based PCs.

Linux was designed around a strong and highly integrated command line interface. Windows and Mac donโ€™t have that. This grants hackers and coder far greater access and control over their system and awesome customization. This is the reason that most hacking and pen testing tools are built into Linux have greater functionality above and beyond their windows counterparts. In contrast, Windows was built around the graphic user interface (GUI). This restrict user interaction to point-and-click navigation (slower) and application/system menu options for configuration.

One of the chief requirements to master Linux is to master its command line structure.ย Master the command line and you’ll be able to perform powerful tasks with just a few keystrokes.

The below cheat sheet will help you remember helpful Linux commands, whether you’re new to Linux or could just use a refresher.

Linux Cheat Sheet

For those who wish to copy the commands in the image directly, here goes

  • mkdirย โ€“ย makeย directories
    Usage:ย mkdirย [OPTION]ย DIRECTORYโ€ฆ
    eg.ย mkdirย lhn
  • lsย โ€“ย listย directoryย contents
    Usage:ย lsย [OPTION]โ€ฆย [FILE]โ€ฆ
    eg.ย ls,ย lsย ยญl,ย lsย lhn
  • cdย โ€“ย changesย directories
    Usage:ย cdย [DIRECTORY]
    eg.ย cdย lhn
  • pwdย ยญ- ย printย nameย ofย currentย workingย directory
    Usage:ย pwd
  • vimย โ€“ย Viย Improved,ย aย programmersย textย editor
    Usage:ย vimย [OPTION]ย [file]โ€ฆ
    eg.ย vimย lhn.txt
  • cpย โ€“ย copyย filesย andย directories
    Usage:ย cpย [OPTION]โ€ฆย SOURCEย DEST
    eg.ย cpย sample.txtย sample_copy.txt
    cpย sample_copy.txtย target_dir
  • mvย โ€“ย moveย (rename)ย files
    Usage:ย mvย [OPTION]โ€ฆย SOURCEย DEST
    eg.ย mvย source.txtย target_dir
    mvย old.txtย new.txt
  • rmย ยญย removeย filesย orย directories
    Usage:ย rmย [OPTION]โ€ฆย FILEโ€ฆ
    eg.ย rmย file1.txtย ,ย rmย ยญrfย some_dir
  • findย โ€“ย searchย forย filesย inย aย directoryย hierarchy
    Usage:ย findย [OPTION]ย [path]ย [pattern]
    eg.ย findย file1.txt,ย findย ยญnameย file1.txt
  • historyย โ€“ย printsย recentlyย usedย commands
    Usage:ย history
  • catย โ€“ concatenateย filesย andย printย onย theย standardย output
    Usage:ย catย [OPTION]ย [FILE]โ€ฆ
    eg.ย catย file1.txtย file2.txt
    catย ยญnย file1.txt
  • echoย โ€“ย displayย aย lineย ofย text
    Usage:ย echoย [OPTION]ย [string]ย โ€ฆ
    eg.ย echoย Iย loveย India
    echoย $HOME
  • grepย ยญ-ย printย linesย matchingย aย pattern
    Usage:ย grepย [OPTION]ย PATTERNย [FILE]โ€ฆ
    eg.ย grepย ยญiย appleย sample.txt
  • ย wcย ยญ-ย printย theย numberย ofย newlines,ย words,ย andย bytesย inย files
    Usage:ย wcย [OPTION]โ€ฆย [FILE]โ€ฆ
    eg.ย ย wcย file1.txt
    wcย ยญLย file1.txt
  • sortย โ€“ย sortย linesย ofย textย files
    Usage:ย sortย [OPTION]โ€ฆย [FILE]โ€ฆ
    eg.ย sortย file1.txt
    sortย ยญrย file1.txt
  • tarย โ€“ย toย archiveย aย file
    Usage:ย tarย [OPTION]ย DESTย SOURCE
    eg.ย tarย ยญcvfย /home/archive.tarย /home/original
    tarย ยญxvfย /home/archive.tar
  • killย โ€“ย toย killย aย process(usingย signalย mechanism)
    Usage:ย killย [OPTION]ย pid
    eg.ย killย ยญ9ย 2275
  • psย โ€“ย reportย aย snapshotย ofย theย currentย processes
    Usage:ย psย [OPTION]
    eg.ย ps,ย ย psย ยญel
  • whoย โ€“ย showย whoย isย loggedย on
    Usage:ย whoย [OPTION]
    eg.ย whoย ,ย whoย ยญbย ,ย whoย ยญq
  • passwdย โ€“ย updateย ย aย userโ€™sย authenticationย tokens(s)
    Usage:ย passwdย [OPTION]
    eg.ย passwd
  • ย suย โ€“ย ย changeย userย IDย orย becomeย superยญuser
    Usage:ย suย [OPTION]ย [LOGIN]
    eg.ย suย remo,ย su
  • chownย โ€“ย changeย fileย ownerย andย group
    Usage:ย chownย [OPTION]โ€ฆย OWNER[:[GROUP]]ย FILEโ€ฆ
    eg.ย chownย remoย myfile.txt
  • chmodย โ€“ย changeย fileย accessย permissions
    Usage:ย chmodย [OPTION]ย [MODE]ย [FILE]
    eg.ย chmodย 744ย calculate.sh
  • zipย โ€“ย packageย andย compressย (archive)ย files
    Usage:ย zipย [OPTION]ย DESTย SOURSE
    eg.ย zipย original.zipย original
  • unzipย โ€“ย list,ย testย andย extractย compressedย filesย inย aย ZIPย archive
    Usage:ย unzipย filename
    eg.ย unzipย original.zi
  • sshย โ€“ย SSHย clientย (remoteย loginย program)
    โ€œsshย isย aย programย forย loggingย intoย aย remoteย machineย andย for
    executingย commandsย onย aย remoteย machineโ€
    Usage:ย sshย [options]ย [user]@hostname
    eg.ย sshย ยญXย [email protected]
  • scpย โ€“ย secureย copyย (remoteย fileย copyย program)
    โ€œscpย copiesย filesย betweenย hostsย onย aย networkโ€
    Usage:ย scpย [options]ย [[user]@host1:file1]ย [[user]@host2:file2]
    eg.ย scpย file1.txtย [email protected]:~/Desktop/
  • fdiskย โ€“ย partitionย manipulator
    eg.ย sudoย fdiskย ยญl
  • mountย โ€“ย mountย aย fileย system
    Usage:ย mountย ยญtย typeย deviceย dir
    eg.ย mountย /dev/sda5ย /media/target
  • umount โ€“ย unmountย fileย systems
    Usage:ย umountย [OPTIONS]ย dirย |ย deviceโ€ฆ
    eg.ย ย umountย /media/target
  • duย โ€“ย estimateย fileย spaceย usage
    Usage:ย ย duย [OPTION]โ€ฆย [FILE]โ€ฆ
    eg.ย du
  • dfย โ€“ย reportย filesystemย diskย spaceย usage
    Usage:ย dfย [OPTION]โ€ฆย [FILE]โ€ฆ
    eg.ย df
  • quotaย โ€“ย displayย diskย usageย andย limits
    Usage:ย quotaย [OPTION]
    eg.ย quotaย ยญv
  • rebootย โ€“ย rebootย theย system
    Usage:ย rebootย [OPTION]
    eg.ย reboot
  • poweroffย โ€“ย powerย offย theย system
    Usage:ย poweroffย [OPTION]
    eg.ย poweroff
  • kateย โ€“ย KDEย Advancedย Textย Editor
    Usage:ย ย kateย [options][file(s)]
    eg.ย kateย file1.txtย file2.txt
  • vimย โ€“ย Viย Improved,ย aย programmersย textย editor
    Usage:ย vimย [OPTION]ย [file]โ€ฆ
    eg.ย viย hello.c
  • geditย ยญย Aย textย Editor.ย Usedย toย createย andย editย files.
    Usage:ย geditย [OPTION]ย [FILE]โ€ฆ
    eg.ย gedit
  • bgย โ€“ย makeย aย foregroundย processย toย runย inย background
    Usage:ย typeย โ€˜ctrl+zโ€™ย ย andย thenย โ€˜bgย โ€˜
  • fgย โ€“ toย makeย backgroundย processย asย foregroundย process
    Usage:ย fgย [jobid]
  • jobsย โ€“ย displaysย theย namesย andย idsย ofย backgroundย jobs
    Usage:ย jobs
  • sedย ยญย ย streamย editorย forย filteringย andย transformingย text
    Usage:ย sedย [OPTION]ย [inputยญfile]โ€ฆ
    eg.ย sedย โ€˜s/love/hate/gโ€™ย loveletter.txt
  • awkย ยญย patternย scanningย andย processingย language
    eg.ย ย awkย ยญF:ย โ€˜{ย printย $1ย }โ€™ย sample_awk.txt
  • findย ยญย searchย forย filesย inย aย directoryย hierarchy
    Usage:ย findย [OPTION]ย [path]ย [pattern]
    eg.ย findย ยญnameย file1.txt
  • locateย โ€“ย findย orย locateย aย file
    Usage:ย locateย [OPTION]โ€ฆย FILEโ€ฆ
    eg.ย locateย file1.txt

Subscribe to our newsletter

To be updated with all the latest news

6 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Subscribe to our newsletter

To be updated with all the latest news

Read More

Suggested Post