Learning Linux

Redhat 6.0 Linux Extra bundle

Linux has been around since 1991 when Linus Torvalds released the first Linux kernel as the basis for the GNU operating system. It became the free replacement for UNIX, providing basic services for applications, such as process management, memory management, and file systems.

Redhat 6.0 Linux Extra bundle

As a system and network administrator, I rely on Linux as an invaluable tool for improving my UNIX and networking skills. Linux is a robust, open-source operating system that can be customized to my needs. Additionally, Linux can transform obsolete machines into useful computer terminals, servers, and routers.

In this article, I’m using a low-end Lenovo Chromebook to demonstrate how to install Linux on a Chromebook. The Chromebook has the following specifications: a Media Tek mt8173 processor, 4 GB of memory, and a 32 GB solid-state drive (SSD).


Getting Started with Linux

Linux is a popular operating system that is easy to learn, and Chromebooks are a great way to learn it. Chromebooks run ChromeOS, which is a Linux-based operating system, and they include a number of Linux tools that make it easy to get started.

It’s easy to set up Linux, aka Crostini, on ChromeOS. First, go to Settings, expand the “Advanced” menu and go to “Developers”. Then “Turn on” Linux: 1: Enable Linux from Chrome settings.

Installing and Using Apache HTTP Server with Crostini

Apache is a free and open-source HTTP server used on approximately 25% of the busiest websites. easily installed on Crostini, this is a great tool for creating web based applications and web pages.

sudo apt install apache2Install apache2 on your chromebook
sudo /etc/init.d/apache2 startStart the Apache server also stop or restart can be substituted for start
ps -aef | grep apache2search running processes for apache2

After installation, open your browser to http://penguin.linux.test and you will see the Apache2 Debian Default Page which contain important information about your webserver configuration.

After enabling Crostini, you wil find a folder in your Launcher name Linux apps which may include desktop Terminals, Files, and more Linux apps.

The terminal is the most important tool included with Crostini. It provides a command-line interface to the operating system, allowing the user to interact with the system and execute commands. The terminal and the commands listed below are included in all versions of Linux and UNIX.

Useful Terminal Commands

CommandDescriptionnotes
sudo apt-get updateThe first command on your terminal should be sudo apt-get update to update your system with the latest patches, wait till finished, its quick!
⬆️ (up arrow)the up arrow button recalls previously entered commands
ctrl cend command, or stop program
sudo allows user to execute a command as a “superuser”. you probably should not use this casually
apt command line interface for package management system. you can add new programs and functions to your computer with these packages example “apt list –installed” will list installed packages, you will see some familiar entries such as usb, vim, etc.
man manual pages for commends. example: man ls -manual page for ls command, space bar = next page, press q to quitman -k keyword : search man for a keyword
ls list directory contentsls -l :list files and directories in a table form including file permissions, file owner, file date, file name. ls -a : shows all files including hidden files.
pwd “present working directory”, print name of current/working directory. note your personal home directory will be /home/yourname
cd change directory example: cd ~ will open your home directory “/home/yourname”. cd / will open the root directory which is “/”
mkdir make directory
vi, vimvi is a screen-oriented text editor originally created for the Unix operating system, vim = “vi improved” version. example: vi test.txt – create/edit test.txt file. press “i” to inset and start writing, press esc and then :wq to write quit or q! to quit without saving. esc toggles between writing mode and command mode
clearclears terminal screen
whoamidisplays your username
top displays Linux processes, type “q” to quit

vi Editor Howto

The vi or vim editor is a powerful tool for editing files, writing programs and scripts.

Lets jump in and write a simple file adn create a sub directory in your home directory (commands are in italic)

first, lets check our directory

yourusername@peguin:~$(command line prompt)
yourusername@peguin:~$ pwd (“present working directory”?)
yourusername@peguin:~$
/home/yourusername
(your home directory, if not, type cd ~ which will change directory to your home
yourusername@peguin:~$mkdir myfilesLets make a directory to store our files named “myfiles”
yourusername@peguin:~$cd myfileslets change our working directory to myfiles
yourusername@peguin:~/myfiles$pwdLets check where are but you will notice that your command prompt now includes your home directory “~” + /myfiles (you can also use the up arrow key to recall the previous pwd command)
yourusername@peguin:~/myfiles$
/home/yourusername/myfiles
The present working directory is listed
yourusername@peguin:~/myfiles$vi mytext.txtHere we go with the vi command creating a new file named “mytext.txt”

Now you are in the editor screen for vi. You can’t type anything yet because you are in normal mode. You have to press the insert command first, which is the “i” key. Once you press “i,” you can start typing. You’ll see the INSERT indicator replace the VISUAL at the bottom left.

OK, so you edited your mytext.txt file. Now let’s save it and get out of here. First, press the esc key to exit insert mode. Next, press the semicolon key : to bring up the command line prompt. Type wq to write and quit the file. Hit enter to go back to the terminal. Congrats! You just created and saved a file using the vi editor.

Lets have a look in our directory and notice that your new file exists

yourusername@peguin:~/myfiles$lstype ls at the command line prompt
mytext.txtyour new file will be displayed
yourusername@peguin:~/myfiles$more mytext.txtlets use the more command which will display the contents of your file. press q to quit

And thats it! you now know about vi editor which is common to all versions of Linux and UNIX :0


Add New Functions to Your Terminal with apt!

Lets add the command whois to your terminal. whois is s client to the whois directory service. first we will use the apt command to install.

sudo apt-get install whoistype this command into the terminal and press enter
whois facebook.comAfter installation is complete, lets take it for spin by looking up the directory listing for facebook.com

Leave a Reply

Your email address will not be published. Required fields are marked *