User Tools

Site Tools


helpful_ubuntu_commands

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
helpful_ubuntu_commands [2025/03/20 11:05] mikehelpful_ubuntu_commands [2025/07/20 10:04] (current) – [Helpful Ubuntu/Linux Commands and Procedures] mike
Line 10: Line 10:
 === List processes and the ports they are listening on === === List processes and the ports they are listening on ===
   netstat -tulpn | grep LISTEN   netstat -tulpn | grep LISTEN
 +or
 +  ss -tulpn | grep LISTEN
      
 === Reload systemd manager configuration after changes made === === Reload systemd manager configuration after changes made ===
Line 41: Line 43:
   du -a /dir/ | sort -n -r | head -n 20 (replace 20 with the # of lines you wish to have returned)   du -a /dir/ | sort -n -r | head -n 20 (replace 20 with the # of lines you wish to have returned)
  
 +=== Find the oldest file in a directory (and it's subdirectories) ===
 +  find . -type f -printf '%T+ %p\n' | sort | head -n 1
 +  
 === Disable colors in the vi editor by default === === 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.   Create (or edit, if it exists) ~/.vimrc; into this file add the command syntax off, and save the file.
Line 94: Line 99:
 Then proceed to format the new drive, i.e. **mkfs -t ext4 /dev/sdb1** Then proceed to format the new drive, i.e. **mkfs -t ext4 /dev/sdb1**
  
 +==== Changing the server's IP address ====
 +  sudo vi /etc/netplan/00-installer-config.yaml
 +  find the existing IP and change it to the desired IP; 'wq' out of the file
 +  sudo netplan apply
 +  
 +==== Changing the server's host name ====
 +  hostnamectl set-hostname [new host name]
 +  
  
helpful_ubuntu_commands.1742493943.txt.gz · Last modified: by mike

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki