🎓 A1Learner
🔍
0 of 50 lessons completed

The Linux Command Reference

A command reference is one list of every command in the course. Each row pairs a command with its job and its lesson.

Find one command

which prints the place of a command. type tells how it runs.

$ cd ~/practice
$ which ls
$ type ls

Two more lookups

tar packs files, and ping checks a connection. The table holds both.

$ cd ~/practice
$ which tar
$ which ping

Example

$ cd ~/practice
$ which ls
$ type ls
$ which tar
$ which ping

Key points

  • An alias gives a long command a short name you can type instead.
  • Export marks a variable so new commands can use it.
  • The commands sit in the order the course teaches them.
  • Use this list when a command slips your mind.
  • Every row here has a lesson behind it.

In this example, which finds ls, tar, and ping. type shows ls as a file on the disk. The table above holds the rest.

Try it Yourself

Edit the code, then press Run.

Running is simulated

Every command in this course

CommandJobLesson
echoPrint wordsThe Terminal
whoamiPrint the current user nameYour First Commands
hostnamePrint the machine nameYour First Commands
datePrint the date and timeYour First Commands
historyList past commandsYour First Commands
manShow the manual pageGetting Help
helpShow help for a commandGetting Help
pwdPrint the current folderWhere You Are
lsList filesWhere You Are
treeList files as a treeWhere You Are
cdMove to another folderMoving Around
statShow the details of a fileListing Files
fileTell what kind of file it isListing Files
mkdirMake a folderMaking Folders
rmdirRemove an empty folderMaking Folders
rmRemove filesMaking Folders
touchMake an empty fileMaking Files
cpCopy filesMaking Files
mvMove or rename filesMaking Files
catPrint a whole fileMaking Files
lessRead a file a page at a timeReading with Less
headPrint the first linesHead and Tail
tailPrint the last linesHead and Tail
wcCount lines and wordsCounting with wc
findFind files by nameFinding Files
grepFind lines with a wordSearching Text
whichShow where a command livesFinding Commands
typeTell how a command runsFinding Commands
envList the variablesFinding Commands
idShow a user and its groupsOwners and Groups
groupsList the groups of a userOwners and Groups
chmodChange permissionsChanging Permissions
chownChange the ownerChanging Owners
chgrpChange the groupChanging Owners
sudoRun one command as the superuserSudo and Root
sortSort linesSorting Lines
uniqDrop repeated linesUnique Lines
cutCut out columnsCutting Columns
trSwap one letter for anotherReplacing Text
sedSwap words in linesReplacing Text
teeSave output to a file as wellPipes
psList processesSeeing Processes
sleepWait some secondsBackground Jobs
jobsList background jobsBackground Jobs
fgBring a job to the frontBackground Jobs
killStop a processStopping Processes
topWatch live processesTop and System Load
uptimeShow the run time and the loadTop and System Load
freeShow free memoryTop and System Load
whoShow who is signed inWho Are You
useraddAdd a userAdding Users
passwdSet a user passwordAdding Users
groupaddAdd a groupGroups
usermodChange the groups of a userGroups
suSwitch to another userSwitching Users
userdelRemove a userSwitching Users
groupdelRemove a groupSwitching Users
dfShow free disk spaceDisk Space
duShow folder sizesFolder Sizes
lnMake a linkLinks
tarPack files into an archiveArchives
gzipShrink one fileArchives
gunzipOpen a shrunk fileArchives
pingCheck a connectionChecking Connections
curlFetch a pageFetching Pages
wgetDownload a pageFetching Pages
ipShow the machine addressesYour Address
ssList what the machine listens forYour Address
ssh-keygenMake a key pairSecure Shell
sshLog in to a remote machineSecure Shell
dpkgList installed packagesListing Packages
aptInstall, list, and remove packagesListing Packages
aliasGive a command a short nameThe Linux Command Reference
exportShare a variable with new commandsThe Linux Command Reference

Exercise

How do you find the lesson that teaches tar?