0% found this document useful (0 votes)
67 views3 pages

Ech Guides: Ubuntu Cheat Sheet (Updated For Systemd Based Versions)

Ubuntu Cheat Sheet

Uploaded by

dysphunctional
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views3 pages

Ech Guides: Ubuntu Cheat Sheet (Updated For Systemd Based Versions)

Ubuntu Cheat Sheet

Uploaded by

dysphunctional
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Ubuntu Cheat Sheet (Updated for systemd base... http://www.opentechguides.com/how-to/article/...

Tech Guides
OPEN Search...

Home HowTo AskOTG New Tutorials Certifications ContactUs

Ubuntu Cheat Sheet (Updated for systemd based


versions)
Updated on 24th May 2017

System Information
lsb_release -a
OS Version (Ubuntu Version)
cat /etc/os-release

Kernel Release Information uname -a

Disk Usage df

Memory Usage free

Uptime uptime

Who are logged in w

System date and time date

Hostname hostname

Hardware Information
lshw
List hardware
lshw -short

lspci
List PCI devices
lspci -v

List USB devices lsusb

List SCSI devices cat /proc/scsi/scsi

Display device driver messages dmesg

(Pipe to grep for specic info) dmesg | grep -i usb

Process Management
List all processes top

List active processes ps -ef

Kill a process with PID pid kill pid

Kill with signal 9 if above doesn't work kill -9 pid

List tree of processes pstree

Which process is using le fuser lename

Networing
ifcong
List network interfaces
ip addr show

1 of 3 06/06/2017 08:31
Ubuntu Cheat Sheet (Updated for systemd base... http://www.opentechguides.com/how-to/article/...

Show routing tables ip route show

Edit /etc/network/interfaces and


Congure an interface
restart networking

systemctl restart networking

Restart Networking /etc/init.d/networking restart

service networking restart

List all ports netstat -a

List all active listening ports netstat -tupl

Service Management
/etc/init.d/myservice start
Start a service called myservice
service myservice start

/etc/init.d/myservice stop
Stop a service called myservice
service myservice stop

/etc/init.d/myservice status
Check status of a service called myservice
service myservice status

systemctl start myservice


For newer versions with systemd instead of
systemctl stop myservice
sysvinit above commands are
systemctl status myservice

Logs
General System Logs /var/log/syslog

Kernel logs /var/log/kern.log

Boot logs (sysvinit based older versions) /var/log/boot.log

Boot logs (sysemd based newer versions) journalctl -b

Kernel ring buer log /var/log/dmesg

Search
nd / -name lename
Search for a le
locate lename

Search for a le in path /home/mydir nd /home/mydir -name lename

Search for all les greater than size 100MB nd / -size +100M

2>/dev/null
Suppress errors while using nd or any command
nd / -size +100M 2>/dev/null

Search for pattern in a le grep pattern lename

Search for pattern in directory grep -r pattern dirname

Package Management
Install a package using apt apt-get install

Check for broken packages apt-get check

Remove broken packages apt-get autoremove

Refresh package list apt-get update

2 of 3 06/06/2017 08:31
Ubuntu Cheat Sheet (Updated for systemd base... http://www.opentechguides.com/how-to/article/...

Upgrade packages apt-get upgrade

Uninstall a package apt-get purge

Install a package using dpkg dpkg -i packagename.deb

Rate it

Related Articles

Post a comment
Got a question about this article? Ask our forum

Name Your Comment

Email (We dont publish it)

I'm not a robot


reCAPTCHA
Privacy - Terms

Comments
Nothing yet..be the rst to share wisdom.

Copyright 2017 Open Tech Guides. All rights reserved

3 of 3 06/06/2017 08:31

You might also like