User Tools

Site Tools


helpful_ubuntu_commands

This is an old revision of the document!


Helpful Ubuntu/Linux Commands


List hard drive serial numbers

lsblk --nodeps -o name,serial

List processes and the ports they are listening on

netstat -tulpn | grep LISTEN

Reload systemd manager configuration after changes made

sudo systemctl daemon-reload

List all installed packages

apt list --installed 

Search for available packages

apt-cache search <keyword>

Changing default editor for visudo

sudo update-alternatives --config editor

Disable GUI screen lock

Settings -> Privacy -> Screen Lock

Disable GUI screen blanking

Settings -> Power -> Blank Screen

Create Samba User

sudo smbpasswd -a <username>

List Samba Users

sudo pdbedit -L

Determine the date the system was installed (not 100% reliable)

tune2fs -l /dev/vda2 | grep ‘Filesystem created:’ (replace vda2 with device where root filesystem is located)

Finding largest files/directories

du -a /dir/ | sort -n -r | head -n 20 (replace 20 with the # of lines you wish to have returned)

Disable colors in the vi editor by default

Create (or edit, if it exists) ~/.vimrc; into this file add the command syntax off, and save the file.

=== Overwrite/blast the boot block on the hard drive (<color red>ONLY when you want to re-install the operating system!</color)

helpful_ubuntu_commands.1735056747.txt.gz · Last modified: 2024/12/24 08:12 by mike

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki