uname -r ; uname -a
free -h
dmesg
cat /etc/rc.conf
ls /home
sudo fdisk -l
cat /etc/fstab
df -h
ls /lib/modules/$(uname -r)
ls /lib/modules/$(uname -r)/kernel/drivers/
lsmod
sudo modprobe module-name
kldload module-name
sudo modprobe -r module-name
sudo rmmod module-name
sudo umount your/path
sudo umount -a
sudo systemctl reboot
sudo swapon
sudo swapon -a
sudo swapoff -a
cat /sys/block/sdX/queue/scheduler
grep "" /sys/block/*/queue/scheduler
echo scheduler-name > /sys/block/sdX/queue/scheduler
lscpu
lsusb -t
lspci -tv
cat /proc/meminfo
sudo dmidecode -t memory
hdparm -t /dev/sdX
ifconfig
iwconfig
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo governor-name | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
startx
cat ~/.xinitrc
glxinfo | grep OpenGL
vulkaninfo | grep Vulkan
Check if you have direct rendering enabled
glxinfo | grep "direct rendering"
Environment variable to make a program use a different Mesa3D driver
MESA_LOADER_DRIVER_OVERRIDE=driver_name program
Environment variable to force a program to use LLVMpipe (OpenGL CPU emulation)
LIBGL_ALWAYS_SOFTWARE=true
(if you want to force all programs of the system to use LLVMpipe add this export LIBGL_ALWAYS_SOFTWARE=true
command to your .bashrc
file on your user folder or your shell configuration file, it's useful when the OpenGL version of your GPU is too low because your GPU is very old, it will make all games run but you can get very bad FPS if the game is vertex intensive)
hostname
hostname -I
ping website-link or ip-address
whois https://websitename.com
clear
!!
su -
sudo -i
doas command
sudo command
sudo !!
exit
whoami
$HOME
echo $SHELL
echo $0
cat /etc/shells
chsh -s /path/of/your/shell
Add an alias/abbreviation for a command on your terminal shell (add this command on your shell configuration file to be permanent, generally a file named .name-of-your-shell-rc
on your user folder)
alias name='command'
passwd user-name
history
history name
sudo chown -R user_name:group-name directory-name
Or
chown username file-name
ls /bin
ls /sbin
echo text
echo $PATH
ldd program-name
export PATH=$PATH:/your/directory
reset
time command
./
The "&" operator is used for multitasking on terminal (it don't start the program process as a child of the terminal, but independent from it, so you can close the terminal, similar of what "exec" command does, replacing the shell process by the called program)
program &
exec program-name
sh script-name
bash script-name
pkill process-name
killall process-name
killall -u user-name
>
This operator store the output of a task on some file but don't overwrite its contents (example: task > file.txt
)
>>
This operator apply a command above the output of other program (example: glxinfo | grep OpenGL
, this command will search for "OpenGL" inside the output of "glxinfo") - this method is technically known as "Unix pipe"
|
git clone https://github.com/user-name/repository-name.git
git clone https://website-name.com/repository-name
git clone https://website-name.com/repository-name your/folder
Download any file (as the HTTP protocol headers are flexible, it can download the wrong file, so try to specify the exact file without header problems, generally an exposed extension of the file in the URL "https://website.com/nameofthefile.extension")
wget https://website-name.com/file-name
wget -c https://website-name.com/file-name
Download any file and try again from where it stopped if the connection failed (by default wget tries 20 times)
wget --tries=anynumber https://website-name.com/file-name
wget -i file.txt
wget --recursive --page-requisites --html-extension --convert-links --no-parent https://website-name.com
curl -O https://website-name.com
wget -C - -O https://website-name.com/file-name
curl -O https://website-name.com -O https://website2-name.com
Example command for custom Wine Prefixes
WINEPREFIX=~/.prefix-name ./wine
WINEPREFIX=~/.prefix-name ./wine explorer
Option to extract AppImage files
--appimage-extract
Download a torrent with webtorrent-cli and open VLC media player
webtorrent download "magnet:..." --vlc
make -j1
sudo make install
ls /etc
ls ~/.local
Show files stored by XDG-compliant programs (FreeDesktop standard)
ls ~/.config
sudo journalctl --vacuum-time=1d
rm -rf ~/.cache/thumbnails/*
sudo apt-get autoremove
sudo apt-get autoclean
package-name*
Or
*package-name
dpkg --configure -a
pkg delete -a
pwd
cd /name/of/your/folder
cd -
cd ..
cd ~
ls
Show all folders/files from a directory, including the hidden ones
ls -a
Show almost all files/folders, excluding the hidden .
and ..
Unix tree files
ls -A
ls *
Show all files/folders inside all the folders of the directory, inclusing hidden ones
ls -a *
ls -l
cat directory/file
grep -nr "text" --include "*.format"
grep -nr "text" --include "file-name.type"
mkdir folder-name
cp file-name destination-folder
Copy a file to other folder, overwrite on destination and maintain the file permissions and timestamps
cp -p file-name destination-folder
cp -v file-name destination-folder
cp -i file-name destination-folder
Copy a file to other folder, maintain permissions/timestamps, show the file being copied, ask permission to overwrite and make a backup
cp -pvib file-name destination-folder
cp -b file-name destination-folder
cp file1 file2 destination-folder
cp -r folder-name destination-folder
cp -r folder-name/. destination-folder
Copy a folder to other folder, maintain permissions/timestamps, show the files being copied, ask permission to overwrite and make a backup
cp -rpvib folder-name destination-folder
cp -r folder1 folder2 destination-folder
mv folder-name destination-folder
Or
mv file-name destination-folder
mv -i file-name destination-folder
mv *.type destination-folder
mv folder-name new-folder-name
rm file-name
Remove/delete any folder recursively without asking for permission (use with caution if you called the command with su/sudo/doas)
rm -rf your-folder
rmdir your-folder
echo "text" >> directory/file
.file-name
or .folder-name
| A dot before the name of a file/folder make it hidden
Search for files on the directory/subdirectories (run with sudo
or su
if these directories are under root permissions)
find . -type f -name file-name
Search for folders on the directory/subdirectories (run with sudo
or su
if the directories are under root permissions)
find . -type d -name folder-name
tree folder-name