Show Menu

Basic Linux Administration Cheat Sheet by

Basic Linux Administration
linux

Server Operation

cal
displays a calendar and the date of Easter
chkconfig
updates and queries runlevel inform­ation for system services
daemon
writing and packaging system daemons
date
print or set system date and time
df -h
report file system disk usage
exit
exit current username session
halt
halt the machine
hostname
show or set the system (SysV) host name
hostna­mectl
control the system (sys­temd) hostname
init
syst­emd init system and service manager
journalctl
query the syst­emd init journal
kill [-s] [-l]
send a signal (kill) to a process
login
begin session on the system
logout
close current username session
reboot
reboot the machine
poweroff
power off the machine
ps
report a snapshot of the current processes
pstree
display a tree of processes
service [command]
run a SysV init script
shutdown -h now
shutdown the machine
systemctl [command]
control the syst­emd init system and service manager
systemd
syst­emd init system and service manager
telinit
change SysV init runlevel
top
display Linux processes
upstart
upst­art init system and service manager
uptime
tell how long the system has been running
Basic server operation for login, logout, shows system date, display server processes, and shutdown the machine.
Please Note, there are several init system in Linux (SysV, systemd, upstart, etc) you should check with command ps -p 1

User Operations

adduser [username]
create a new username or update default new username inform­ation
deluser [username] [--rem­ove­-al­l-f­iles]
delete a username account and related files
getent [group] [| less]
print user groups
getent [passwd] [| less]
print user account
groups [username]
print the groups current username is in
id
print real and effective user and group IDs
passwd
change password for current user name
su [username]
change username or become super user
sudo [command]
execute a command as super user
useradd [username]
create a new username or update default new username inform­ation
userdel [username] [-r]
delete a username account and related files
usermod [username] -aG [group­name]
modify a username account into suplem­entary group­name
who
show who is logged on
whoami
print effective user id
Basic user operation such as create user, delete user, change password, list active user, etc
 

Network Operation

curl [url]
transfer a url with supported protocol eg. HTTP, HTTPS, SMTP, FTP, etc.
dig [domain]
dig (domain inform­ation groper) DNS lookup utility
ftp
internet file transfer program to another host
host
DNS lookup utility
hostname
show or set the system (SysV) host name
hostna­mectl
control the system (sys­­te­md) hostname
ifconfig
configure a network interface
ip
show/m­ani­pulate routing, devices, policy routing and tunnels
iptables
admini­str­ation tool for IPv4/IPv6 packet filtering and NAT
mtr
a network diagnostic tool
netstat
print network connec­tions, routing tables, interface statis‐ tics, masquerade connec­tions, and multicast member­ships
ping [host]
send ICMP ECHO_R­EQUEST to network hosts
scp
secure copy (remote file copy program)
route [host]
show/m­ani­pulate the IP routing table
sftp
secure file transfer program
ssh
OpenSSH SSH client (remote login program)
ssh-keygen
authen­tic­ation key genera­tion, management and conversion
telnet
user interface to the TELNET protocol
traceroute [host]
print the route that packets follow to another host
ufw [--dry­-run] [options] [rule syntax]
uncomp­licated firewall a program for managing a netfilter firewall
whois
get inform­ation about a domain name
Basic network operation and networ­kse­curity such as check network connec­tion, setup firewall, ssh secure shell connec­tion, trace network path, etc

Filename or Command Execution

[command] | less
more with advance features
[command] | more
filter for displaying text one screen at the time
alias [command]
define or display aliases command
bash [command]
GNU Bourne­-Again SHell for execute command
cat [filename]
concat­enate filename and print on the standard output
echo [text]
display a line of text
head [filename]
output the first part of filename
ln
make links between files
source [filename]
execute commands from a filename in the current shell
tail [filename]
output the last part of filename
touch
change file timestamps

Help and Other Command

[command] --help
display command help
help [command]
display command help
info [command]
read Info command documents
man [command]
an interface to the on-line reference manuals for command
nano [filename]
Nano's ANOther editor, an enhanced free Pico clone
vim [filename]
Vi IMproved, a progra­mmers text editor
Help, others important command and common text editor for Basic Linux Admini­str­ation

File and Directory Operations

apt-get install [package]
APT package handling utility to install dkpg package
apt-get remove [package]
APT pakcage handling utility to remove dkpg package
apt-get update
APT package handling utility to synchr­onize index file of available dkpg package
cd [direc­tory]
change current direc­tory
chgrp
change group ownership
chmod
change file access permission
chown
change file owner and group
cp
copy files and directory
df -h
report file system disk usage
dpkg
package manager for Debian & Ubuntu
find [filename]
search for filename in a directory hierarchy
getent [filename]
get entries from Name Service Switch or filename libraries
grep
print lines matching a pattern
gzip
compress or expand files
locate [filename]
find filename by name
ls -l [| more]
list directory content
mkdir [direc­tory]
create direc­tory
mv filename
move (rename) filename
pwd
print name of curren­t/w­orking directory
rm [filename]
remove filename
rmdir [diretory]
remove direc­tory
rpm
package manager for Fedora & CentOS
tar
the GNU version of the tar archiving utility
wget [url]
the non-in­ter­active network downloader
which [command]
locate a command
yum install [package]
Yellowdog Updater Modified Synopsis for install rpm package
yum remove [package]
Yellowdog Updater Modified Synopsis for remove rpm package
yum update [package]
Yellowdog Updater Modified Synopsis for update rpm package
Basic file operation such as list directory, change working directory, instal­lation, set file permis­sion, compress file, find file location, etc.
Please Note, there are several package system in Linux (dkpg for Debian & Ubuntu or rpm for Fedora & CentOS)

Download the Basic Linux Administration Cheat Sheet

3 Pages
//media.cheatography.com/storage/thumb/ygautomo_basic-linux-administration.750.jpg

PDF (recommended)

Alternative Downloads

Share This Cheat Sheet!

 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Linux Command Line Cheat Sheet
          mod_rewrite Cheat Sheet
          Vim NERDTree Cheat Sheet