Shell¶
Tip
You can loop up information about commands by executing:
$ man <name>
For example, to lookup ls execute:
$ man ls
Information¶
unamedisplay operating system namedatedisplay the dateuptimeshow how long the operating system has been runningwhoamishow the current user idmandisplay the manual page for a command
Directory Operations¶
pwddisplay working directorymkdirmake a directorycdchange directorylslist directory contents
ls Options¶
-ainclude directory entries whose name begins with a.-Rrecuresively list subdirectories encountered-rreverse the order of the sort-tsort by time modified-Ssort files by size-llist in log format-1output one entry per line-mlist files accross the page separated by commas-Qenclose entry names in double quotes
Searching¶
grepprint lines matching a patternfind dir -name "pattern"searchdirfor files matchingpatternfind dir -iname "pattern"the above but ignore casewhereislocate the binary, source, manual page files for a commandlocatefind files by name
grep Options¶
-iignore case-rrecursive-vselect non-matching lines-oshow only the matching part of matching lines
File Operations¶
touchchange file timestampscatconcatenate files and print tostdoutmorefile perusal filter for viewinglesslikemorebut supports backward movementfiledetermine file typecpcopy files and directoriesmvmove (rename) filesrmremove files or directoriesheaddisplay the first lines of filestaildisplay the last lines of fileschmodchange file access permissions
Process Management¶
psreport a snapshot of current processestopdisplay linux process tablekillterminate a process using process idpgreplookup process based on namepkillkill process based on namekillallkill processes by name