Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Linux System Administration Cheat Sheet

by WBrandes via cheatography.com/89603/cs/20393/

Network Commands System & Disk Commands Common Commands (cont)

Command Descri​ption Parame​‐ Command Descri​ption Parameters mv Moves a Can be used to


ter​/Usage du Disk usage; h: human file rename files, by
wget Downloads something from a shows disk readable. a: 'moving' a file to the

web address usage of files all files, not same directory, with a
in directory just direct​‐ different name
ssh Remote login "ssh
or command userna​‐ ories rmdir Removes a directory
run me@​ser​‐ free Shows amount of free & and mkdir Creates -p to make parents;
ver​" used memory in system a can build a chain of
scp, sftp Remote file copy df Report on file system & disk directory non-ex​istent direct​‐
space usage ories all at once
openssl For generating stuff for
encryption lsblk Report info about block touch Updates Can be used to create
devices a file's files- it will create a file
ssh- For generating public​/pr​ivate
last-e​‐ if the given file does
keygen key pairs fdisk Manipulate l: list disks
dited not exist
dnf Package manager for Fedora. disk
date.
Use it to download, update, partioning
history lists history of previous commands
and install all sorts of software Uname Print system inform​ation
man Lists manual page for a given
ifconfig Use without parameters to get export For setting an enviro​nment
command, that'll tell you alllll
general info on network variable
about what a command can do
connec​tions. Also used for unmount Unmounts the specified disk
and how to use it
assigning IP addresses and
eject Ejects the specified disk
setting up networking config reboot Reboots the machine
stuff for interface devices
Common Commands
Direct​ories
netmask Used for setting network
Name Descri​ption Parame​ter​s/Notes
submask Directory Descri​ption
ls list l: long, more
route For adding entries to a routing /etc All sorts of system​-wide config​‐
everything detailed view. a:
table uration stuff
in given show all, even
netstat For displaying network info /proc/​‐ CPU info
directory hidden files/​dir​ect​‐
cpuinfo
ip For Internet Protocol activities (default is ories
present dir) /etc/p​‐ User account info
traceroute Given an address, will identify
asswd
all of the places your packets cd navigate to another directory
travel to to get to that address /etc/group Group info
pwd Present Working Directory; shows
ping Sends packets to an IP, seeing current directory /etc/s​‐ Where passwords are actually
how long it takes to get a hadow kept
cp Copy a file from one place to
response /etc/skel Skeleton, template home
another
dig Queries DNS servers to get directory for copying to make
rm Remove a f: force remove,
info on a domain new home direct​ories
file or ignoring warnin​gs/​‐
directory any​thing. r:
recursive; use this
to delete direct​ories

By WBrandes Published 24th September, 2019. Sponsored by CrosswordCheats.com


cheatography.com/wbrandes/ Last updated 4th December, 2019. Learn to solve cryptic crosswords!
Page 1 of 3. http://crosswordcheats.com
Linux System Administration Cheat Sheet
by WBrandes via cheatography.com/89603/cs/20393/

Direct​ories (cont) Automation and Daemons (cont) Input / Reading Commands (cont)

/etc/s​yst​‐ Daemon config file / setup at For scheduling a command to run dd Reads bytes from a location
emd​/system stuff just once
/etc/s​ysl​‐ Config​uration for syslog atq Lists commands in the queue that Groups, Users, and Permis​sions oh my
og.conf logging daemon have been scheduled to run Command Descri​ption Parameters
/var/log Where logs are kept atrm Remove a command from the queue passwd For changing and setting
/etc/hosts Config​uration for network test For checking files and values; any passwords
hosts yes/no question about our system useradd For adding a new user
/etc/n​etworks Config​uration for networks su Switch user
Input / Reading Commands
usermod Modify a user account
Process Commands Command Descri​ption Parameters
chown For changing ownership of a
Command Descri​ption Parame​ locate For searching for files file / directory
ter​‐ find For searching for files chmod For changing permis​sions of a
s/Usage
less Text viewer for viewing large file / directory
top Displays and updates lots of files groupadd Add a group
info on running processes
nano Good, simple text editor
prestres Displays current running Syntax & Jargon
vim Complex, powerful text editor
processes as a tree
vimtutor Used for learning vim Symbol Descri​ption
fg Foregr​ound; fg %[job
/ Term
cat Concat​enate files and print
resume a number]
them to stdout stdin Standard input; the input a
suspended process or fg
command is looking to for what it
or bring one back [process echo Echoes whatever it is given;
should work with. Generally
from the ID] useful for sending text
comes from keyboard; could be a
foreground somewhere
file or something else, if we
bg Backgr​ound; puts a process head Read first few n: number
redirect stuff
into the background lines of a file of lines to
stdout Standard output; typically is the
and print them read
Note: if you want to put a currently running
console. Can be changed to a file
to stdout
command in the backgr​ound, use CTRL+Z,
or something if we redirect it.
and then fg & bg tail Read last few n: number
stderr Standard error; where errors are
lines of a file of lines to
kill Kills a command in the
printed to.
and print them read
background
to stdout | Pipe. Used to send output of one
command directly to another like,
Automation and Daemons awk Used for viewing files in
"​history | less"
complex ways, like looping
Command Descri​ption Parameters
through a file and only looking > Send output of command
systemctl Managing system​s/s​erv​ices, in somewhere.
at certain patterns and
particular daemons
column​s/rows in a file >> Append output somewhere.
journalctl part of systemd, can be used
>& or Send stdout and stderr
to see loggin​g/e​rrors for
&> somewhere
daemons
2> Send just stderr somewhere
crontab Used for setting up automated
running of commands / scripts
at certain dates or intervals via
cron

By WBrandes Published 24th September, 2019. Sponsored by CrosswordCheats.com


cheatography.com/wbrandes/ Last updated 4th December, 2019. Learn to solve cryptic crosswords!
Page 2 of 3. http://crosswordcheats.com
Linux System Administration Cheat Sheet
by WBrandes via cheatography.com/89603/cs/20393/

Syntax & Jargon (cont) Miscel​laneous Commands (cont)

1> Send just stdout somewhere whereis Like which but searches a
& Put at the end of a command to broader area than just your
run it in the backgr​ound, shell's search path
immedi​ately returning console to sort Sorts r: reverses sort order. h:
you. text for sorting human-​rea​‐
$ When on prompt, means that dable byte counts
you're a regular user ln Used for creating links between
# When on prompt, means that files; shortcuts basically
you're the root user chsh Change shell
? Wildcard character - when a stty Setting key commands (like
command receives '?' in its backspace to delete)
input, it will take that mean to (Use "stty sane" to unbork a borked shell)
any single character
clear Clears terminal of text
* Wildcard for any number of
script Saves everything that comes up
charac​ters. I.e. "​*.t​xt" would
in your console, until exit is
refer to any thing/file ending in
called
".tx​t"
[abc] Wildcard for given characters
(here, a, b, or c). Can also
define a range, i.e. [1-3]
CTRL+U Delete current line
CTRL+C Abort whatever's currently
running
CTRL+Z Suspend whatever's currently
running

Miscel​laneous Commands

Command Descri​‐ Parameters


ption
yes Spams a string until forcibly
stopped
sudo Runs the given command as
root
shutdown Shuts "​shu​tdown now" to
down do it now
system
halt Shuts p: needed on most
down systems to power
system down hardware
reboot Same as halt but reboots
which Finds if a command exists and
where it is

By WBrandes Published 24th September, 2019. Sponsored by CrosswordCheats.com


cheatography.com/wbrandes/ Last updated 4th December, 2019. Learn to solve cryptic crosswords!
Page 3 of 3. http://crosswordcheats.com

You might also like