Choose style:

Author Topic: Basic "Short List" of frequently use Terminal Commands for Ubuntu/Debian Based L  (Read 310 times)

0 Members and 1 Guest are viewing this topic.

Offline The Omen

  • Jr. Member
  • **
  • Posts: 55
  • Karma: 10
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9 respin
Hi Folks, This is my "short list" of some very basic "terminal commands" that i hope will help and prove useful to the members of the Peppermint Forums. I have written it out so all you should need to do is "copy and paste" these commands into your "terminal":

I would like to ask or request that the more knowledgeable and "Seasoned Veterans" Such as Mr. Mark Greaves, and/or Moderators etc. Could add a line or two here in this pre-amble to assure others that these commands will be safe for others to use.

Please also be sure to read posts below, BEFORE executing any of the Terminal Command Codes offered in this Tutorial Posting that are provided by the aforementioned "Seasoned Vet's". They may provide more indepth insites as to any ramafications that could be incurred through use of any of these Terminal Commands offered here.

Also feel free to add, amend, or delete anything that may jump out at you as either redundant, superceeded, or otherwise known to be dangerous to use on an otherwise healthy system.

They all work for me but that doesn't mean they will work for everyone based soley on my own experience.

Please let me know if this tutorial is at all helpful to the forum at large.

NOTE - As an addendum here, I feel Honor bond and obligated to add that none of this is from my own meager knowledge and so-called "expertise", I need to give due honor and respect to my "Linux Mentor", Whom, over the last 2 years has shared most of his, (In my personal opinion), VAST knowledge with me and, (though he declares otherwise, and does tend to be quite humble in my opinion), "steered" me here to this forum, whereas he said 'For the most part, This is probably one of the best forums you could possibly be a member of, though one that does not have a resounding number of members, and beware of those that might "bait" you, that can and WILL result in misunderstandings.Keep your cool, never be "baited" by "trolls", keep yourself "beyond the pale" and you will do well as a help to the forum community at large'.

Thank-You for reading:

"The Omen":


Auto Clean/Auto Remove.
Code: [Select]
sudo apt autoclean
Code: [Select]
sudo apt autoremove
Code: [Select]
sudo apt autoremove --purge

Clear the Thumbnail Cache
Code: [Select]
rm -rf ~/.cache/thumbnails/*

Clear DNS Cache
Code: [Select]
sudo systemd-resolve --statistics
Code: [Select]
sudo systemd-resolve --flush-caches

Remove ALL Old Kernels Except Active Kernel: This is the easiest way to remove an over abundance of unused kernels that are now redundant: Just make sure to go into the update manager and reinstall the last known good kernel thereafter: You don't want to be reliant on only the active kernel without a backup to retreat with in case the existing active kernel is borked in some way.
It doesn't happen often but WILL happen once in a great while:
Code: [Select]
dpkg-query -W -f '${Version}\n' 'linux-image-[^g]*'|sort -u|sed -e '/^$/d' -e 's/\~[^~]*$//' -e 's/\.[^.]*$//' -e "/$(uname -r|sed 's/-generic\|-lowlatency//')/d" -e 's/.*/linux-*-&*/'|tr '\n' ' '|xargs -r sudo apt-get remove --purge -y

Remove Old Kernels Except Latest 2 (If you also have Byobu Terminal installed)
Code: [Select]
sudo purge-old-kernels

Kernel and other Cleanups after Deletions
Code: [Select]
sudo apt autoremove
OR
Code: [Select]
sudo apt autoremove --purge

Do the following one at a time, dont worry if the first "dpkg -l" says error etc...just means nothing is there to remove is all:
Code: [Select]
dpkg -l | grep '^rc' | awk '{print $2}' | sudo xargs dpkg --purge
Code: [Select]
dpkg -l | grep '^rc' | awk '{print $2}' | xargs sudo apt-get purge

This one below will hopefully show just the active kernel and last known good one:
Code: [Select]
dpkg --get-selections | grep linux-headers && dpkg --get-selections | grep linux-image

Defrag Command: NOT!!! usually necessary and be aware your dev/sda may not be the numeral (1 )for your main drive but another number depending on partition set up: WARNING!!!, NEVER, EVER USE THIS COMMAND ON AN SSD DRIVE, THIS IS HDD ONLY!!!:
Code: [Select]
sudo e4defrag /dev/sda1

Purge Apport Service: For those not liking to send crash reports back to Ubuntu:
Code: [Select]
sudo apt purge apport

Purge Indexing: Only for those who don't really need indexing:
Code: [Select]
sudo apt purge apt-xapian-index

Purge Ice: For those who do not want "cloud" online stuff, Be sure to open it first and delete ALL ice apps first, then remove "ice":
Code: [Select]
sudo apt purge ice

Purge Snapd: For those of you, who like myself, absolutely abhor using "snaps" versus either the repositories or .deb pkgs for installing programs/software:
Code: [Select]
sudo apt purge snapd

Purge Gnome-Software Repository (SNAP)The follow up after removing "snapd":
Code: [Select]
sudo apt-get remove --purge gnome-software gnome-software-plugin-snap

Remove Flatpak remotes: First off, To show your remote sources:
Code: [Select]
flatpak remotes

Then:

Delete the sources as in this example:For those of you, like myself, that detest "flatpaks" install versus either the repositories or .deb installation methods
Code: [Select]
flatpak remote-delete flathub

Purge Samba: For those who have no need for cross platform apps. etc.:
Code: [Select]
sudo apt purge samba

Purge telnet: I believe this is probably not even necessary any longer on modern systems for the most part, Sooooo 1990s:
Code: [Select]
sudo apt purge telnet

Purge Flash: Flash is going "bybye" very shortly anyways in favor of html, i havent found need for it in years:

PLEASE NOTE THE FOLLOWING FROM PCnetSpec BEFORE REMOVING FLASH:  DO NOT uninstall flashplugin-installer if you use ICE SSB's .. some sites (including some default SSB's) may rely on flash:
Code: [Select]
sudo apt purge flashplugin-installer

Purge btrfs: Rarely used by most average users because default set-up is in rsync. It can save time during boot-up process so the system does't look for it:
Code: [Select]
sudo apt-get purge btrfs-progs && sudo update-initramfs -uk all

Disable Dialup Modem: May be necessary for some who still rely on baud rate style modems that require old style phone connection with loud screeching noises to connect to the internet: The old AOL, commonly referred to as AO hell days:
Code: [Select]
sudo systemctl disable pppd-dns.service

Disable lvm-2-monitor: Logical Volume Manager, not recommended for complete computer novices to be using, some folks have a need for this but the average user usually finds no need nor use thereof:
Code: [Select]
sudo systemctl disable lvm2-monitor

Install BYOBU for Kernel Removal
Code: [Select]
sudo apt install byobu

Ubuntu Additional Codecs: Some folks like me have found this useful to have:
Code: [Select]
sudo apt install ubuntu-restricted-extras

Install psensor: The first code provides the very basic heat monitor to your system. the second command provides other sensors to add to psensor that may or may not be on your system:
Code: [Select]
sudo apt install psensor
Code: [Select]
sudo sensors-detect

Install xfburn: My opinion?, The best and simplest CD/DVD burner to use:
Code: [Select]
sudo apt install xfburn

Install System Monitor: A great program for monitoring your linux system:
Code: [Select]
sudo apt install gnome-system-monitor

Install System Profiler and Benchmark: This is a GREAT program for access to tell you everything about Hardware in your system with a great amount of benchmark test included. If you ever used "speccy" with Windows systems, you will love this one even better:
Code: [Select]
sudo apt install hardinfo

Install Disk Usage Analyzer: This has a couple of great graphics representation of your hardrive as well as software installed on your systems HDD or SDD:
Code: [Select]
sudo apt install baobab

Shutdown/Reboot Commands: The first command is for shutdown, the second is for reboot on both sets of commands respectively:
Code: [Select]
shutdown -Ph now
Code: [Select]
shutdown -Pr now

Or: Both will work just fine for those of you who prefer to make your own launchers on the panel for shutdown and reboot funtions: Choose one set or the other as you see fit:
Code: [Select]
systemctl poweroff
Code: [Select]
systemctl reboot

Check DNS: This will allow you to see just what DNS you are using:
Code: [Select]
nmcli device show | grep DNS

Test Which DNS is Being Used: This is just another way to do the same thing:
Code: [Select]
systemd-resolve --status | grep "DNS Servers:"

When Repositories fail to update your system: Most times this simply fixes that minor annoyance:
Code: [Select]
sudo apt update

Change Grub Timeout
Code: [Select]
sudo nano /etc/default/grub
Edit the line listed (GRUB_TIMEOUT=10) to read ("arrow" down and then "arrow" over to the number 10) and change it to 0...(GRUB_TIMEOUT=0) (This is a zero)

GRUB_TIMEOUT_STYLE=hidden

Press Ctrl-O (note that this is an O and not a zero)...then press "enter"...then press "save" from the "tab" in that same box...then Ctrl-X to exit the editor...then run in the terminal,
Code: [Select]
sudo update-grub
then reboot
               
Remove Rarely Used Fonts: Each series of commands (3 of them) should remove all unwanted fonts:

!!!!DO NOT DO THIS if you rely on Asian Fonts!!!:

The first command:
Code: [Select]
sudo apt-get -y --purge autoremove fonts-beng fonts-beng-extra fonts-deva fonts-droid fonts-gubbi fonts-gujr fonts-gujr-extra fonts-guru fonts-guru-extra fonts-kacst fonts-kacst-one fonts-kalapi fonts-khmeros-core fonts-knda fonts-lao fonts-lklug-sinhala fonts-lohit-beng-assamese fonts-lohit-beng-bengali fonts-lohit-deva fonts-lohit-gujr fonts-lohit-guru fonts-lohit-knda fonts-lohit-mlym fonts-lohit-orya fonts-lohit-taml fonts-lohit-taml-classical fonts-lohit-telu fonts-nakula fonts-nanum fonts-navilu fonts-noto-unhinted fonts-orya-extra fonts-pagul fonts-sahadeva fonts-samyak-deva fonts-samyak-gujr fonts-samyak-mlym fonts-samyak-taml fonts-sarai fonts-smc fonts-sil-abyssinica fonts-sil-padauk fonts-takao-pgothic fonts-taml fonts-telu fonts-telu-extra fonts-thai-tlwg fonts-tibetan-machine fonts-tlwg-garuda fonts-tlwg-garuda-ttf fonts-tlwg-kinnari fonts-tlwg-kinnari-ttf fonts-tlwg-laksaman fonts-tlwg-laksaman-ttf fonts-tlwg-loma fonts-tlwg-loma-ttf fonts-tlwg-mono fonts-tlwg-mono-ttf fonts-tlwg-norasi fonts-tlwg-norasi-ttf fonts-tlwg-purisa fonts-tlwg-purisa-ttf fonts-tlwg-sawasdee fonts-tlwg-sawasdee-ttf fonts-tlwg-typewriter fonts-tlwg-typewriter-ttf fonts-tlwg-typist fonts-tlwg-typist-ttf fonts-tlwg-typo fonts-tlwg-typo-ttf fonts-tlwg-umpush fonts-tlwg-umpush-ttf fonts-tlwg-waree fonts-tlwg-waree-ttf fonts-wqy-microhei fonts-wqy-zenhei ttf-indic-fonts-core ttf-punjabi-fonts ttf-wqy-microhei
The second command:
Code: [Select]
sudo apt-get --purge autoremove fonts-kacst fonts-kacst-one fonts-khmeros-core fonts-lao fonts-lklug-sinhala fonts-nanum fonts-sil-abyssinica fonts-sil-padauk fonts-takao-pgothic fonts-tibetan-machine fonts-tlwg-garuda fonts-tlwg-kinnari fonts-tlwg-loma fonts-tlwg-mono fonts-tlwg-norasi fonts-tlwg-purisa fonts-tlwg-sawasdee fonts-tlwg-typewriter fonts-tlwg-typist fonts-tlwg-typo fonts-tlwg-umpush fonts-tlwg-waree ttf-indic-fonts-core ttf-punjabi-fonts ttf-wqy-microhei
The third command:
Code: [Select]
sudo apt-get --purge autoremove fonts-kacst* fonts-khmeros* fonts-lklug-sinhala fonts-guru-extra fonts-nanum* fonts-noto-cjk fonts-takao* fonts-tibetan-machine fonts-lao fonts-sil-padauk fonts-sil-abyssinica fonts-tlwg-* fonts-lohit-* fonts-beng-extra fonts-gargi fonts-gubbi fonts-gujr-extra fonts-kalapi fonts-lohit-* fonts-samyak* fonts-navilu fonts-nakula fonts-orya-extra fonts-pagul fonts-sarai fonts-telu* fonts-wqy* fonts-smc* fonts-deva-extra

Ram Information: This will tell you all about your RAM that is installed:
Code: [Select]
sudo dmidecode --type memory | less

Change Password: Changing your ROOT password:
Code: [Select]
sudo passwd root

System Specs: Should ALWAYS be used and posted to the forums when requesting help for your particular system. There is no such a thing as "one size fits all" when it comes down to fixing a problem. we all have our own customized systems: What works for me may not work for you:
Code: [Select]
inxi -Fxz

Test FPS: this is a neat little command to estimate your frames per second rate that your system is capable of measured in 5 second intervals:
PLEASE TAKE NOTE OF WARNING FROM PCnetSPEC FOR NVIDIA USERS:

  vblank_mode=0 glxgears
doesn't disable vertical sync for glxgears when using nvidia drivers .. instead nvidia users need to run:
 
Code: [Select]
__GL_SYNC_TO_VBLANK=0 glxgears
that command starts with TWO underscores)

NOTE---These 2 underscore do not show very clearly within the "code tags" but should work fine nonetheless when copy and pasted to your terminal.

For Intel and AMD users, Use the following codes below:
Code: [Select]
glxgears
Code: [Select]
vblank_mode=0 glxgears


Stop Screen Tearing: INTEL PROCESSORS ONLY!!!

Test sreen tearing as a before and after using this site:

https://www.youtube.com/watch?time_continue=2&v=5xkNy9gfKOg


Open a terminal and run these commands in sequence:

 
Code: [Select]
sudo apt-get install mesa-utils
Then

 
Code: [Select]
sudo mkdir -v /etc/X11/xorg.conf.d

Then

 
Code: [Select]
echo -e 'Section "Device"\n Identifier "Intel Graphics"\n Driver "Intel"\n Option "AccelMethod" "sna"\n Option "TearFree" "true"\nEndSection' | sudo tee /etc/X11/xorg.conf.d/20-intel.conf
I have seen variations of these codes than the ones I have posted on this site, but these codes have worked on all INTEL PROCESSORS ONLY!!! systems I have used it on.

Now REBOOT to apply the changes. 

To UNDO

Open a terminal and run:

 
Code: [Select]
sudo rm -v /etc/X11/xorg.conf.d/20-intel.conf
Now REBOOT.
« Last Edit: October 02, 2019, 11:21:27 am by The Omen »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25725
  • Karma: 2822
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
Great list, hope you don't mind but I've cleaned up the post a bit with CODE tags

Also, three things for readers to be aware of:-

a) DO NOT uninstall flashplugin-installer if you use ICE SSB's .. some sites (including some default SSB's) may rely on flash.

b) I'm personally not a massive fan of using general commands or an application for removing old kernels, they rarely also remove all the additional kernel support packages .. personally I do a search and manual removal. That said I realise you need to know what to search for, I'm just more of the opinion you should learn that as opposed to using apps or random commands gleaned from the web.

c) Officially Peppermint would **REALLY** have to advise against running
Code: [Select]
sudo passwd root
unless you FULLY understand the implications as this will activate the 'root' account and set an unencrypted root password, Peppermint doesn't set an unencrypted 'root' password by default, instead it uses 'sudo' to temporarily elevate your users privileges .. in our opinion this is generally more secure.

See here for an explanation of 'sudo' versus an active 'root' account
https://help.ubuntu.com/community/RootSudo

But as long as you understand the up/downsides, your call.
« Last Edit: September 22, 2019, 05:24:00 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline The Omen

  • Jr. Member
  • **
  • Posts: 55
  • Karma: 10
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9 respin
Thank-you, Mark,  I really appreciate you cleaning that up with code tags for me. it seems much more legible this way.

I'm also happy to see the "caveat emptors" in your reply for others as well as myself that just did not occur to me.

I'm also happy to see that "The Short List" passes "muster"

Again many thanks for allowing this and hoping it may be good to just refer others to this since ive noticed in Linux forums in general, unless i missed something, i haven't seen any "most commonly used terminal commands" list to date.

Regards, The Omen
« Last Edit: September 22, 2019, 05:51:10 pm by The Omen »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25725
  • Karma: 2822
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
No worries :)

BTW, I've just realised
Code: [Select]
vblank_mode=0 glxgears
doesn't disable vertical sync for glxgears when using nvidia drivers .. instead nvidia users need to run:
Code: [Select]
__GL_SYNC_TO_VBLANK=0 glxgears
(that command starts with TWO underscores)
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline The Omen

  • Jr. Member
  • **
  • Posts: 55
  • Karma: 10
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9 respin
Hi guys, As a side note here, Please feel free if any of this is useful to anyone in the forums to drop a line here and "stoke up" my  evil, "ooops - errrr, ahhh", i meant Ego as well as self esteem levels, or denegrate me in the appropriate fashion, lol-lol-lol,

PS-Karma points for or against also appreciated-heheheheheh.

only kidding unless you really mean it.

This is such a great and fun easy going forum, im glad my Linux "Mentor" steered me here.

He told me that, for the most part, almost all were the greatest, most helpful, individuals a forum could have.

Warm Regards to all,

The Omen
« Last Edit: September 22, 2019, 08:34:46 pm by The Omen »

Offline The Omen

  • Jr. Member
  • **
  • Posts: 55
  • Karma: 10
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9 respin
Please take note that i have added the following to the end of my "Short List" on this "Tutorial".

Quote
Stop Screen Tearing: INTEL PROCESSORS ONLY!!!

Warm Regards,

The Omen
« Last Edit: October 02, 2019, 11:28:15 am by The Omen »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25725
  • Karma: 2822
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline The Omen

  • Jr. Member
  • **
  • Posts: 55
  • Karma: 10
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9 respin
I am really sorry Mr. Greaves.

I did not know that this already existed in the tutorials. I have only been here with the forum for ten days and have not had enough time to find out what is already here.

I was only referring to the USB storage commands my "mentor" gave me to work with, which is kind of humongous.

I have already been instructed to give you the best respect possible, and am sorry if i have been disrespectful of you in any way.

Again my apologies sir.

Warm Regards,

The Omen
« Last Edit: October 02, 2019, 08:16:42 pm by The Omen »

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 25725
  • Karma: 2822
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 8R, 9, and 9R
NP, just pointing it out :)
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline The Omen

  • Jr. Member
  • **
  • Posts: 55
  • Karma: 10
  • New Forum User
    • View Profile
  • Peppermint version(s): Peppermint 9 respin
Yes sir, and thank you sir,  for pointing this out to me.

This is not a "Flippant Response", I TRULY,  REALLY,  MEAN IT when i say "thank - you sir and yes sir,  as a REAL and TRUE mark of respect to you sir.

The Omen
« Last Edit: October 02, 2019, 11:03:38 pm by The Omen »