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 (ONLY when you want to re-install the operating system!)
dd if=/dev/zero of=/dev/sda count=1 bs=512
Find files consuming the root file system
mkdir /tmp/rootbind mount --bind / /tmp/rootbind du -d 1 -h /tmp/rootbind
Solution for Linux systems not visible in the "Network Neighborhood" on Windows machines
apachectl install wsdd
helpful_ubuntu_commands.1735057967.txt.gz · Last modified: 2024/12/24 08:32 by mike