UNIX/LINUX Top100 Commands
Version 1.20 — 31.5.2021
© 2003–2021 T. Birnthaler, OSTC GmbH
31. Mai 2021
Inhaltsverzeichnis
1 The most important UNIX/LINUX commands 2
2 Other important UNIX/LINUX commands 3
UNIX/LINUX Top100 Commands — 1.20 — 31.5.2021 © 2003–2021 T. Birnthaler, OSTC GmbH
1 The most important UNIX/LINUX commands
man CMD Display description forCMD[manual]
whatis CMD Display one line of description forCMD(man-index!) apropos TEXT Display one line of description for topicTEXT(man-index!) info CMD Display description forCMD(GNU programs!)
help [CMD] Display description for all/builtin shellCMD(bash) CMD --help Display usage message forCMD(GNU programs!)
CMD -h -? -. Display usage message forCMD(all other programs!) [help]
type [-a] CMD Search forCMDtype/place (builtin/alias/function/binary,bash, [all]) which/whence CMD Search forCMDtype/place ((t)csh/ksh)
who Display all users logged in
whoami who am i Display currently (in terminal) logged in user
id [-a] [USER] Display own/USERname + group memberships + IDs [identity/all]
su [-[l]] USER Switch to accountUSER(-=-l=incl. environment!) [switch user/login]
su su -[l] Become superuserroot(without/with environment change!) exit logout Switch back to former account resp. log out from terminal sudo CMD Execute one(!) command asroot[superuser do]
passwd [USER] Change (own/USER) password (1x old, 2x new one) [password]
more/less FILE... DisplayFILE. . . page by page (alsopg,page) CMD | more/less DisplayCMDoutput page by page
lp/lpr FILE... Print outFILE. . . (lpr=BSD,lp=SysV) [line print]
CMD | lp/lpr Print outCMDoutput
pwd Display current directory [print working directory]
cd [PATH] cd ˜ Switch to directoryPATH/own home directory [change directory]
cd / cd .. cd - Switch to root/parent/previous directory
ls [DIR|FILE...] Display content of current dir./DIR/FILE(alphabetically sorted) ls -l ... Display file names + attributes . . . [long]
ls -a ... Display all file names (hidden ones.XXXtoo!) [all]
ls -d ... Display only directory name, not content [directory]
ls -h ... Display file size in units K/M/G/T/. . . instead bytes [human readable]
ls -F ... Append file type postfix to name (*=exe,/=dir,@=link) [Flag]
ls -R ... Display whole directory tree fromDIRon [Recursive]
ls -r ... Sort descending instead of ascending [reverse]
ls -S ... Display sorted (ascending) by file size [Size]
ls -t ... Display sorted (ascending) by modification time [time]
ls --color=auto File type by color (black=file, blue=dir, turq.=link, green=exec, yellow=device) touch FILE... Update change date ofFILE. . . or create new file [touch]
* *.txt *.* Matches all files/extension.txt/dot in file name in current directory mv FILE NAME RenameFILEtoNAME[move]
mv FILE... DIR MoveFILE. . . to directoryDIR[move]
mv FILE DIR/NAME MoveFILEto directoryDIRand rename it [move]
cp FILE NAME CopyFILEtoNAME(overwrite!) [copy]
cp FILE... DIR CopyFILE. . . to directoryDIR[copy]
ln FILE NAME Create hard linkNAMEtoFILE[link]
ln -s FILE NAME Create symbolic linkNAMEtoFILE[symbolic]
rm FILE... DeleteFILE[remove]
rm -r DIR... Delete complete directory tree starting atDIR. . . [recursive]
mkdir DIR... Create directoryDIR. . . [make directory]
rmdir DIR... Delete directoryDIR. . . (must be empty!) [remove directory]
cat FILE1 FILE2... Concatenate files and output them tostdout[concatenate]
<STRG-D> Logout (instead ofexit/logout) or end of input [EOF/end of file]
chmod MODE FILE... Change file perm. [ugoa][+-=][rwxst] (only owner!) [change mode]
umask [NNN] Display/set standard permission mask000-777for new files/dirs (permissions to be removed,r=4,w=2,x=1!) [usage mask]
umask Displays022(Suse, RedHat) or002(Debian, Ubuntu) chusr USER FILE... Change owner toUSER(onlyroot!) [change user]
chgrp GROUP FILE... Change group owner toGROUP(only owner!) [change group]
UNIX/LINUX Top100 Commands — 1.20 — 31.5.2021 © 2003–2021 T. Birnthaler, OSTC GmbH
2 Other important UNIX/LINUX commands
<CTRL-C> CancelCMDentry or currently runningCMD(SIGINT= 2) [cancel]
ps Display own processes [process status]
ps aux ps -ef Display all processes (BSD/SysV) [all/user/extended/every/full]
kill PID/%JOB... Stop (background) processPID/JOB. . . / (standard signalSIGTERM= 15) kill -9 PID... Stop processPID. . . unconditionally (SIGKILL= 9)
kill -l List all signal names + numbers [list]
CMD & RunCMDin background (asJOB)
NOHUP CMD & Analogous, no stop on logout [no hangup]
<CTRL-Z> bg Switch runningCMDto background [background]
jobs Display all background processes of shell CMD < FILE Read input forCMDfromFILE
CMD > FILE Write output ofCMDtoFILE CMD >> FILE Append output ofCMDtoFILE
CMD 2> FILE Write error messages ofCMDtoFILE(not(t)csh!) CMD 2>> FILE Append error messages ofCMDtoFILE(not(t)csh!) CMD 2> /dev/null Ignore error message ofCMD
CMD > FILE 2>&1 Write output + error messages ofCMDtoFILE(not(t)csh!) CMD1 | CMD2 Connect output ofCMD1with input ofCMD2[pipe]
VAR="TEXT" Set shell variableVARto valueTEXT(no space around=!) set VAR "TEXT" Set shell variable for to valueTEXT((t)csh, no=but space!) export VAR Convert shell variableVARto environment variable
setenv VAR="TEXT" Set environment variable to valueTEXT((t)csh,=necessary!) echo $VAR Display content of shell/environment variableVAR
HOME PWD Standard directory forcd(home directory) resp. current directory HOST HOSTNAME Name of machine
LANG LC_ALL LC_* Language settings (C,en_US.UTF-8,de_DE.UTF-8) [language/locale]
PAGER VIEWER Name of standard viewer (e.g.more/less; autom. called byman) PATH Search path for executables (dirs separated by:)
PS1 prompt Define shell prompt (sh/(t)csh) [prompt string]
TERM Terminal type (editors,more,curseslibrary) [terminal]
USER LOGNAME Name of logged in user [login name]
EDITOR VISUAL Name of standard editor (e.g. autom. called bycrontab,visudo) PRINTER LPDEST Name of standard printer (e.g. autom. called bylp/lpr)
find [DIR] ... Search/list/process files/dirs by name + attr. starting from curr. dir/DIR grep "TEXT" FILE... Display lines ofFILEcontainingTEXT[global regex print]
CMD | grep "TEXT" Display lines ofCMDoutput containingTEXT head [-N] FILE... Display first 10/N lines ofFILE
CMD | head [-N] Display first 10/N lines ofCMDoutput tail [-N] FILE... Display last 10/N lines ofFILE
CMD | tail [-N] Display last 10/N lines ofCMDoutput
tail -f FILE... Show added lines at end ofFILEcontinuously [follow]
tail +N FILE... Show lines from lineNofFILE. . .
wc -l FILE... Display number of lines inFILE[word count/lines]
CMD | wc -l Display number of lines ofCMDoutput
echo [-n] "TEXT" DisplayTEXTon terminal (with/without linefeed) [no newline]
clear <CTRL-L> Erase terminal content (blank screen) [formfeed/leeren]
date [+FORMAT] Display date + time (according toFORMAT, e.g.%T %D %H:%M:%S %d.%m.%Y) more/less FILE... Page throughFILEby following cmds (manautom. usesmore/less):
<SPACE> <RETURN> Skip to next page/one line further (space/return key)
b Skip one page back (onlyless!) [backward]
/TEXT ?TEXT SearchTEXTforward/backward (onlyless!)
n N Repeat last search forward/backward (onlyless!) [next]
:next :prev Jump to next/previous (onlyless!) file [next/previous]
q h Leavemore/less[quit]; Display help [help]
Strg-R TEXT... Search cmd history for last one containingTEXT[research]
Strg-R... Search next. . . cmd in history containingTEXT[research]
Cursor-Up/Down Goto previous/next cmd in history
!NR !TEXT !! Execute cmd numberNR/cmd beginning withTEXT/last cmd from history