/usr/local/ for your user profile
/opt/ for shared users
- Download your app (*.tar.gz) from a reputable website.
- Unpack the .tar.gz file you downloaded to an appropriate location (see File Structure above).
- Execute the *.sh file.
A cheat sheet of the package manager name and usage options for each platform.
| Description | Ubuntu | Arch | Fedora |
|---|---|---|---|
| Package Manager | apt |
pacman yay |
dnf |
| Package Details | pacman -si |
||
| Update Packages | apt update && apt upgrade |
pacman -Syu |
dnf update |
| Find Package | apt search pkg |
pacman -S pkg yay pkg |
dnf search pkg |
| Install | apt install pkg |
pacman -Ss pkg yay pkg |
dnf install pkg |
| Uninstall | apt remove pkg |
pacman -Rsu pkg yay -R pkg |
dnf remove pkg |
| Package Cache Size | du -sh /var/cache/pacman/pkg |
||
| Package No Longer in Repos | pacman -Qm |
||
| Remove Depencencies | apt autoremove |
pacman -Qtdq | sudo pacman -Rns - |
dnf autoremove |
| Remove Package Cache | pacman -Scc |
These are the folders holding temp files that can consume disk.
~/.cache
/tmp
/var/tmp
/var/log
/var/cache/pacman/pkg
# journalctl
journalctl --disk-usage
jouralctl --vacuum-time=1days
jouralctl --vacuum-time=1weeks
jouralctl --vacuum-time=1months
journalctl --vacuum-size=200M
Command to locate a file. To search for a file that contains two or more words, use an asterisk (*).
Review the commands you’ve entered before.
history
Find files by name by ignoring case.
locate -i school*note
To find files in the current directory.
find . -name notes.txt
To look for directories.
/ -type d -name notes. txt
View the first 1o lines of a text file.
head
View the last 10 lines of a text file.
tail
Compares the contents of two files line by line. After analyzing the files, it will output the lines that do not match.
diff
Find running processes.
ps -ef | grep nginx
Create a tar.gz file
tar -czvf file.tar.gz directory
Secure copy files to a remote server.
scp file.tar.gz user@server_name:/folder_path/
sudo apt install net-tools
Report on network connections. For example, good way to find programs listening for TCP connections on the system (e.g., Apache, Nginx).
netstat -tlp
-tTCP protocols-nNumbers (e.g., for ports)-lActive listeners-pProgram names
Configure network adapters and interfaces.
sudo ifconfig eth0 down
sudo ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
sudo ifconfig eth0 up
To print log entries from systemd
journalctl
Print the kernel messages.
dmesg
List of all PCI components.
lscpi
List of all hardware components.
lshw -C video
A report on the system’s disk space usage. Use -m option to report in MB.
df -m
How much space a file or a directory takes.
du
Report USB devices battery.
upower