Linux¶
Change hostname¶
Change permanently with
Check
Reboot is required to show it in the prompt
Message Of The Day (MOTD)¶
Add a new message¶
Write something like that:
Change permissions
Logout login to check
APT packet research¶
When you want to execute a command, but you don't remind the name of the packet who contain this command you can try:
Simply run the command¶
On Ubuntu, it will help you with the package to install:
$ traceroute
Command 'traceroute' not found, but can be installed with:
sudo apt install inetutils-traceroute # version 2:2.6-1ubuntu3, or
sudo apt install traceroute # version 1:2.1.6-1
Search using apt-file¶
Install apt-file
Update list
If you know exactly the path you can try:
Example for the dig command
-F will search for this exact pattern
else you can try:
That will search all packets that contain a script named dig
-x specify that pattern is a regex.
Example output:
apt-file find -x /dig$
apparmor: /etc/apparmor.d/dig
bind9-dnsutils: /usr/bin/dig
epic4: /usr/share/epic4/script/dig
epic4-help: /usr/share/epic4/help/8_Scripts/dig
Here we can guess that to correct one is bind9-dnsutils
Journalctl¶
A CLI tool to manage logs.
To see all logs
To see only 20 last logs
To follow logs output
To see kernel logs only
To see specific process logs (example for ssh service)
To filter by time:
To filter by log level:
-b: To see error only until last reboot-p 1: To see log level 1 and above
There are 8 log levels, from the most critical to the most informative
| Log level | Name |
|---|---|
| 0 | emerg |
| 1 | alert |
| 2 | crit |
| 3 | err |
| 4 | warning |
| 5 | notice |
| 6 | info |
| 7 | debug |
Misc¶
tldr¶
Get useful command usage example
Install
Get tar usage example:
sudoedit¶
To edit a root file use sudoedit instead of sudu vi.
It allows you to still have your user .vimrc config.
Files and folders size¶
Get size of a folder
Get files and folders size with a TUI
Install
Use (press q to quit)