Most common Linux Commands

Other commands:

  1. apt-cache search (sudo not required)

It is useful to get the exact package names to be used for an “apt install”. I use “apt-cache search”. For example:

apt-cache search numpy | grep python3

Of course these days one can also do a search with apt (apt has the best of apt-get, apt-cache, …), but I find it to not be as reliably grep-able.

  1. dpkg --get-selections and “sudo dpkg --set-selections”

The first gives a list of installed/deinstalled pacakges. The second will set dpkg selections so that if you do a “sudo apt update” and “sudo apt upgrade” it will install all the packages. I find this useful if I’ve done a lot of installs and I want to wipe and reinstall with the same package selections.

dpkg --get-selections > package_list.txt

And after a system reinstall one can duplicate those installed packages by copying that package_list.txt file and setting those selections:

sudo dpkg --set-selections < package_list.txt
sudo apt update
sudo apt upgrade

2 Likes

sudo apt autoremove got rid of that annoying gnome message in the store. Thanks for that.

1 Like

I have tried most of the information related commands, lscpu I thought would just say arm64 1.5 Ghz or something like that but it told me all kinds of stuff like mitigations to attacks, neat cheat sheet. Getting used to shell, once you know what the words mean then the commands arent much different from clicking on the icons in a gui. I sometimes forget bash vs terminal meanings but it is getting clearer.

2 Likes

In case anyone wants to dive deeper into commandline, there is also: Linux Command Line Books by William Shotts - The book got updated last fall to 6th edition over 15years and is almost 600pages of everything linux commandline related. The site also has some language versions available, downloadable examples and it’s all free, under Creative Commons License.

3 Likes

Thank you JR-Fi you are a beast at this.

2 Likes