Introduction to Linux Commands
Overview of Common Linux Shell Commands
What is a shell?
-
User interface for running commands
-
Interactive language
-
Scripting language
Shell command applications:
-
Getting information
whoami
– usernameid
– user ID and group IDuname
– operating system nameps
– running processestop
– resource usagedf
– mounted file systemsman
– reference manualdate
– today’s date
-
Navigating and working with files and directories
-
Printing file and string contents
-
Compression and archiving
tar
– archive a set of fileszip
– compress a set of filesunzip
– extract files from a compressed zip archive
-
Performing network operations
hostname
– print hostnameping
– send packets to URL and print responseifconfig
– display or configure system network interfacescurl
– display contents of file at a URLwget
– download file from a URL
-
Monitoring performance and status
Customizing View of File Content
sort
— Sort lines in a file,-r
will do the same in the reverseuniq
— Filter out repeated linesgrep
(“global regular expression print”) — Return lines in file matching patterngrep -i
— makes grep search case-insensitivecut
— Extracts a section from each linepaste
— Merge lines from different files