Learning Linux Ubuntu Class notes #1 & #2

in linux •  6 years ago 

I love to learn new thing and very often undertake some sort of new study, sometimes out of pure interest and sometimes out of necessity.

This latest learning venture takes me on a journey I previously never considered, and to be honest this time its more out of necessity than interest. I think I have a mental block about learning something that does not fascinate me and this is going to be a uphill struggle.  

My First lesson was rather boring.  I learned how to install virtualbox and set up a virtual machine and I learned how to install Ubuntu on my windows laptop.  We spent some time learning about Linux distributions and finding our way around our Ubuntu Desktop.

I tend to jump ahead of myself a lot and during this lesson my thoughts wondered.  I want to learn this stuff to help me run a witness server on STEEM.  How is running Ubuntu on a virtual machine with a desktop interface going to help me here.  The server stuff looks nothing like this. where is the black screen with the flashy cursor? How much of this stuff is going to be relevant?  Is this all a waste of my time????  I think I decided it was because I don't have any notes to share with you about that class.

My second class was more engaging.  We started some work on Linux command line.  Thankfully I managed to stay focused for this class.  I got that black screen with the flashing cursor that I am was previously familiar with staring at wondering what the heck I am supposed to do.

The thing is I know I am not the only one running blockchain software on a server with no idea what they are doing. Whether it’s running a masternode software or a STEEM witness, people like me rely on the skills and knowledge of others to really make these things run.  

I am using steem to keep a kinda learning log and maybe some of the stuff I learn, by sharing it here, can also help others. 

So lets get into some command lines

When you screen is just getting to full type clear

Change directory: cd – this is a command built into the shell

 Example 1: cd / - this will change directory to an absolute path from the root directory, for example cd /user/myuser.  However, you can change the path to a relative directory by omitting the /

Example 2: cd ./ - this will change the current directory to the level of the current directory.  For example we are in user, cd ./myuser will bring us to myuser.  

To quickly jump to home you can use cd ~

Print working directory: pwd – this will show you the directory you are currently in

To list all the content from the current directory in alphabetical order use ls.  To list in reverse alphabetical order use ls -r

To list contents with more details, use ls -l. -l standing for long.  Here you will find permissions, user, user group and date.

To include file types in the list use ls -p and to sort based on file size use ls -s

You can also pass a path to the ls command for example ls /user/myuser

And you can string commands together such as ls -r -d which would return a list in reverse alphabetical order of only directories

To get help on the ls command use ls

  The command nano is the terminal text editor 

Administrator privileges are granted to sudo users.  Standing for super user do.

To repeat the last command use !!

To repeat the last command with admin privileges use sudo !! (for example, you tried to edit a file and could not because you did not have the rights, you can run sudo !! and it will re-run the command under sudo)

To change user the command is su. If you use sudo su, you will change the user to sudo. To change back to your own account use su myuser (replace myuser with account name)

To manage packages, use the program apt-get. This program can preform a number of actions 

To install a package, use apt-get install filename, to remove its apt-get remove filename.  To use apt-get you many need to be a sudo user.

To search the Ubuntu repository for a package, use apt-cache search filename*

To check if you have a package installed use apt-cache policy filename

You can install a package that is not in the official repositories.  .deb files work with apt package manager.  Once you download the file, use cd to navigate to downloads and use the following command sudo dpkg -i ./filename.deb

To update packages and check for updates use sudo apt-get upgrade. 

That's my class notes shared and up to-date.  I hope by sharing these notes I can help others and also reinforce the learning for me.  If you are reading this and you know about Linux and Ubuntu and you see any glaring mistakes, please do let me know.


Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Nice write-up! Just a minor remark:

If you use sudo su, you will change the user to sudo. To change back to your own account use su myuser

If you use sudo su, you'll spawn a new shell session as user root, running inside the previous user session. While you get to myuser with another su myuser from there, this actually spawns another shell session inside the root session which already runs inside the user session - so you're actually 3 levels deep, not "back". You could just use Ctrl+d (or type exit) from the root session to get back to the original user shell.

oh. Thank you for this. Am I correct in saying if I use sudo su, I don't need to keep retyping sudo to do admin actions until I change the user?

yes, this is correct.

Really really long time ago I learned also Linux, It was fun time.

Maybe the usage of two` around a terminal command make it more readable.
$rewarding 80% 14min silent

good point - will add ' moving forward. thanks for visiting

@holger80, what is 'silent' for? :)

'silent' suppresses a command accepted reply from rewarding.

Posted using Partiko Android

Ah ok, thanks.

Posted using Partiko Android

Consider using apt dist-upgrade instead of apt upgrade.

what does the 'dist' mean? distinct?

Distribution. It upgrades dependencies.

Here is a bit more on it.
https://ubuntuforums.org/showthread.php?t=2267752

nice share, thank you

Obviously it's kind of early in the process. Which course are you taking and would you recommend it so far?

Posted using Partiko Android

Im taking a class in my local IT tech, and when it comes to learning, i always recommend it. If you have a need to know this subject then my answers is yes.

Haven't used Linux in many years (unfortunately, I'd say). So nice to remember some of the command line elements.

linux better than windows? And, what are the advantages of linux over windows?

from a comparison view, the updates with windows are a bit of a pain, but I personally rather the UI. As most of the world are not technical I dont see any advantage of linux over windows really. On saying that I am at a very early stage of learning

thanks for your information. i'll try linux one time.

Command line in Linux is better.

Posted using Partiko Android

Hi @paulag!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 6.924 which ranks you at #93 across all Steem accounts.
Your rank has dropped 3 places in the last three days (old rank 90).

In our last Algorithmic Curation Round, consisting of 243 contributions, your post is ranked at #2. Congratulations!

Evaluation of your UA score:
  • You've built up a nice network.
  • The readers appreciate your great work!
  • Great user engagement! You rock!

Feel free to join our @steem-ua Discord server