Skip to content

Latest commit

 

History

History
78 lines (56 loc) · 1.9 KB

Linux.md

File metadata and controls

78 lines (56 loc) · 1.9 KB

Useful Linux commands

[TOC]

Linux OS

uname -a                                # print system information
neofetch                                # shows information to linux os & dist

Debug

tail -f filename.log                    # follow log file
tail -f /var/log/syslog                 # Network logs

Filter

apt list | grep 'rhythmbox'             # Match
apt list | grep -v 'bionic'             # Inverse match shows all packages that are not from bionic store

Packages

apt list --installed                    # Installed user packages
dpkg --list | grep firefox              # Installed packages from debian installer

ls /var/cache/apt/archives/             # Install cache packages

Print

lpq -a                                  # Show all pending print jobs
lprm [id]                               # Cancel print job

Secure Copy

scp filename.txt user@host:/myPath      # Copy file from local filesystem to target fs
scp -r foldername user@host:/myPath     # Copy folder from local filesystem to target fs

Networking

ifconfig								# show network information
iwconfig								# show wireless information
ifup [interface]						# activate network interface
ifdown [interface]						# deactivate network interface
ping [host]								# show connection details to host
traceroute [host]						# show routing to host
netstat -tupl							# show activate listening ports

Processing

[cmd] &									# run command in background
[cmdA] ; [cmdB]							# run cmdA then cmdB
[cmdA] | [cmdB]							# run cmdA and use output as input in cmdB
[cmdA] || [cmdB]						# run cmdA and cmdB when cmdA was not successful
[cmdA] && [cmdB]						# run cmdA and cmdB when cmdA was successful

Power Consumption

sudo powertop							# show current power consumption
sudo tlp-start							# show current battery status