Linux Fundamentals (summarized)

* A Bit of Background on Linux

Linux is a command line operating system based on Unix. There are multiple operating systems that are based on Linux.

Linux is just another operating system and one of the most popular in the world powering smart cars, android devices, supercomputers, home appliances, enterprise servers, and more.

--------------------------------------------

Linux powers things such as:


- Websites that you visit.


- Car entertainment/control panels.


- Point of Sale (PoS) systems such as checkout tills and registers in shops.


- Critical infrastructures such as traffic light controllers or industrial sensors.

-------------------------------------------------------------------------------------------------------------

Flavors of Linux


The name "Linux" is actually an umbrella term for multiple OS's that are based on UNIX (another operating system). Thanks to UNIX being open-source, variants of Linux comes in all shapes and sizes - suited best for what the system is being used for.


- Ubuntu & Debian are some of the more commonplace distributions of Linux because it is so extensible.


- Ubuntu Server can run on systems with only 512MB of RAM


- Ubuntu can be run as a server or as a fully-fledged desktop.


The focus in this training is on Ubuntu 


Documentation: https://help.ubuntu.com

Management:    https://landscape.canonical.com

Support:     https://ubuntu.com/advantage

--------------------------------------------

An Introduction to Shell Operators.

--------------------------------------------

Linux operators are a fantastic way to power up the knowledge of working with Linux.


----------------------------------------------------------------------------------------------------

1. & This operator allows you to run commands in the background of your terminal. 


example: 'copying a large file'

----------------------------------------------------------------------------------------------------

2. && This operator allows you to combine multiple commands together in one line of your terminal. 


example: 'command1 && command2'


However, command2 will only run if command1 was successful.

----------------------------------------------------------------------------------------------------

3. > This operator is a redirector (or output redirector) - meaning that we can take the output from a command (such as using cat to output a file) and direct it elsewhere.


A great example of this is redirecting the output of the echo.


example: echo "hey" > welcome


Note: if the file i.e. "welcome" already exists, the contents will be overwritten.

----------------------------------------------------------------------------------------------------

4. >> This operator does the same function of the > operator but appends the output rather than replacing (meaning nothing is overwritten).


example: echo "hello" >> welcome


in this case: 


cat welcome =>


hey

hello    (output)

-------------------------------------------------------------------------------------------------------------

Basic commands: 

-----------------------

Commands Description


echo   Output any text that we provide


whoami   Find out what user we are currently logged in as


ls listing


cd change directory


cat     concatenate


pwd print working directory


find quickly search for files across the entire system that our user has access to


grep      allows us to search the contents of files for specific values that we are looking for

--------------------------------------------------------------

examples:

- find -name passwords.txt

- find -name *.txt

- wc -l access.log

- grep "81.143.*.*" access.log

--------------------------------------------------------------

SSH

--------------------------------------------------------------

SSH: Secure Shell

Secure Shell or SSH simply is a protocol between devices in an encrypted form.

Using cryptography, any input we send in a human-readable format is encrypted for travelling over a network -- where it is then unencrypted once it reaches the remote machine.

- SSH allows us to remotely execute commands on another device remotely. 

- Any data sent between the devices is encrypted when it is sent over a network such as the internet
------------------------------------------------------------------------------------------
The syntax to use SSH is very simple. We only need to provide two things:

1. The IP address of the remote machine

2. Correct credentials to a valid account to login with on the remote machine
------------------------------------------------------------------------------------------
Common Directories 
------------------------------------------------------------------------------------------
/etc 

This root directory is one of the most important root directories on the Linux system. 

The etc folder (short for etcetera) is a commonplace location to store system files that are used by the operating system. 

It contains "passwd" and "shadow". These two files are special for Linux as they show how your system stores the passwords for each user in encrypted formatting called sha512.


-------------------------------------------------------------------------------------------------------------

/var 

var is short for variable data. 

This directory is one of the main root folders found on a Linux install. 

This folder stores data that is frequently accessed or written by services or applications running on the system. 

for example: log files from running services and applications are written here: /var/log (or other data that is not necessarily associated with a specific user (i.e. databases and the like))

-------------------------------------------------------------------------------------------------------------

/root

The /root folder is actually the home for the "root" system user. 
"full access"

This user would have their data in a directory such as "/home/root"

-------------------------------------------------------------------------------------------------------------

/tmp 

This is a unique root directory found on a linux system. /tmp is short for "temporary". This directory is volatile, 

and is used to store data that is only needed to be accessed once or twice 

Similar to the memory on your computer, once the computer is restarted, the contents of this folder are cleared out.

=== > What's useful for us in Pentesting is that any user can write to this folder by default. Meaning once we have access to a machine, it serves as a good place to store things like our enumeration scripts. < ===

-------------------------------------------------------------------------------------------------------------

Filesystem 

-------------------------------------------------------------------------------------------------------------

Command Full Name Purpose

touch         touch Create file
mkdir         make directory Create a folder
cp         copy Copy a file or folder
mv         move Move a file or folder
rm         remove Remove a file or folder
file                 file         Determine the type of a file
------------------------------------------------------------------------------------

Creating files and folders (touch, mkdir)

It is a simple process, the touch commands takes exactly one argument 
--the name we want to give the file we create. 

for example: touch note 

The created file is blank.
echo command or text editors software needed to add content to the blank file. 

-----------------------------------
The process is similar for making a folder, using mkdir command 

example: mkdir directory

----------------------------------------------------------------------------------------

Removing Files and folders(rm)

rm is extraordinary out of the commands that are already covered.

- to remove a file: rm file 

- to remove a directory, a '-R' switch is required alongside the name of the directory 
example: rm -R directory 

-----------------------------------------------------------------------------------------------

Copying and Moving files and folders.(cp, mv)

* the cp command takes two arguments :

1. the name of the existing file 
2. the name we wish to assign to the new file when copying 

example: cp file1 file2

* the mv command takes two arguments, mv will merge or modify the second file that we provide as an argument. 

* mv can also be used to rename a file or a folder

example: mv notefile notefile1 

-----------------------------------------------------------------------------------------------

Determining file type

Files usually have what is known as an extension to make this easier.

eg: text files => .txt 

- using the file command, we can find the file type. 
- this command takes one argument. 

for example: file note 
output: note: ASCII text
------------------------------------------------------------------------------------------------
Introduction to Flags and Switches

--------------------------------------------------------
When using a command, unless otherwise specified, it will perform its default behavior. For example, ls lists the contents of the working directory. However, hidden files are not shown. We can use flags and switches to extend the behavior of commands.

example: ls -a 

after using the -a argument (short for --all)

we now suddenly have an output with a few more files and folders such as ".hiddenfolder". Files and folders with "." are hidden files.

--------------------------------------------------------

The Man(ual) Page:

The manual pages are a great source of information for both system commands and applications.

online: https://linux.die.net/man/ (Linux man pages)

To access this documentation, we can use the "man" command and then provide the command we want to read the documentation for. 

example: man ls

--------------------------------------------------------
Permissions 101
--------------------------------------------------------
Using ls -lh to list the permissions of all files in the directory

d for directory 
- for folder 
r for read
w for write 
x for execute 

su command : switch user 

---------------------------------------------------------------------------

Switching Between Users

two thing required to switch: 

- the user we wish to switch to 
- the password of this user 

the su command takes a couple of switches that may be of relevance to us. 

example: su user2

-----------------------------

By providing the '-l' switch to su, we start a shell that is much more similar to the actual user logging into the system.

and we inherit a lot more properties of the new user (i.e. environment variables and the likes...)

=> su -l user2 

after using -l, the new session dropped us into the home directory of user2 automatically.
----------------------------------------------------------------------------------------------------------

General Useful Utilities

----------------------------------------------------------------------------------------------------------
* Downloading Files
-----------------------------------------------------------------------------------------------------------------------------
wget https://www.gnu.org/software/wget/

usage: wget https://assets.tryhackme.com/additional/linux-fundamentals/part3/myfile.txt

- This command allows us to download files from the web via HTTP -- as if you were accessing the file in your browser. 

---------------------------------------------------------------------------------------------------------------------------------------------------------
Transferring Files From Your Host - SCP (SSH) Secure copy.

- This command allows you to transfer files between two computers using the SSH protocol to provide both authentication and encryption.

SCP allows you to:

* Copy files & directories from your current system to a remote system
* Copy files & directories from a remote system to your current system


=> we should know usernames and passwords for a user on our current system and a user on the remote system.

---------------------------------------------------------------------------------------------------------------------------------------------------------
* First Example : from our machine to a remote machine 
-----------------------------
=> command: scp important.txt ubuntu@192.168.1.30:/home/ubuntu/transferred.txt
-----------------------------
The command's information broken to pieces: 

- 192.168.1.30:         The IP address of the remote system
- ubuntu: User on the remote system
- important.txt:         Name of the file on the local system
- transferred.txt:         Name that we wish to store the file as on the remote system (while stating a directory on the destination system)

note that after the scp command: 
part 1 Source (important.txt) (our machine)
part 2 Destination (ubuntu@192.168.1.30:/home/ubuntu/transferred.txt) (remote machine)
-----------------------------------------------------------------------------------------------------------------------------
* Second Example : from remote machine to our machine
-----------------------------
=> command: scp ubuntu@192.168.1.30:/home/ubuntu/documents.txt notes.txt
-----------------------------
The command's information broken to pieces: 

- IP address of the remote system                                     =>  192.168.1.30
- User on the remote system                                                      =>         ubuntu
- Name of the file on the remote system     =>  documents.txt
- Name that we wish to store the file as on our system                     =>  notes.txt
-----------------------------------------------------------------------------------------------------------------------------
note that after the scp command: 
part 1 Source (ubuntu@192.168.1.30:/home/ubuntu/documents.txt) (remote machine)
part 2 Destination (notes.txt) (our machine)
-----------------------------------------------------------------------------------------------------------------------------
Serving Files From Your Host - WEB

- Ubuntu machines come pre-packaged with python3

- Python helpfully provides a lightweight and easy-to-use module called "HTTPServer". 

- This module turns your computer into a quick and easy web server that you can use to serve your own files

- where they can then be downloaded by another computing using commands such as "curl" and "wget". 

- Python3's "HTTPServer" will serve the files in the directory that you run the command. (this can be changed by providing options that can be found in the manual pages)

command:    python3 -m  http.server (to start the module)
expected output:   Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
-------------------------------------------------------------------------
- Using "wget" tool to download the file using our computer's IP address and the name of the file. 

( One flaw with this module is that you have no way of indexing, so you must know the exact name and location of the file that you wish to use. )

Hence we have "UpDog" (A more advanced yet lightweight webserver.)

(Updog is a replacement for Python's SimpleHTTPServer. It allows uploading and downloading via HTTP/S, can set ad hoc SSL certificates and use http basic auth.) source: https://github.com/sc0tfree/updog

------------------------------------------------
wget usage/command: wget http://127.0.0.1:8000/file
-------
output:
---------------------------------------------------------------------------------------------------------------------

2021-05-04 14:26:16  http://127.0.0.1:8000/file
Connecting to http://127.0.0.1:8000... connected.
HTTP request sent, awaiting response... 200 OK
Length: 51095 (50K) [text]
Saving to: ‘file’

file                    100%[=================================================>]  49.90K  --.-KB/s    in 0.04s

2021-05-04 14:26:16 (1.31 MB/s) - ‘file’ saved [51095/51095]
---------------------------------------------------------------------------------------------------------------------
This request is logged by SimpleHTTPServer (much as any web server would)
-------
output: 
---------------------------------------------------------------------------------------------------------------------
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
127.0.0.1 - - [04/May/2021/14:26:09] "GET /file HTTP/1.1" 200 -
--------------------------------------------------------------------------------------------------------------------

Maintaining Your System

--------------------------------------------------------------------------------------------------------------------
1. Automation | Crontab 
------------------------------------------------------------------------------------------------------
Users may want to schedule a certain action or task to take place after the system has booted. Take, for example, running commands, backing up files, or launching your favourite programs on, such as spotify, or google chrome. 

we are going to be talking about the cron process, but more specifically, how we can interact with it via the use of crontabs. Crontab is one of the processes that is started during boot, which is responsible for facilitating and managing cron jobs.

https://assets.tryhackme.com/additional/linux-fundamentals/part3/cron1.png

A crontab is simply a special file with formatting that is recognised by the cron process to execute each line step by step. Crontabs require 6 specific values:

1. MIN: What minute to execute at. 
2. HOUR: What hour to execute at.
3. DOM: What day of the month to execute at. 
4. MON: What month of the year to execute at. 
5. DOW: What day of the week to execute at.
6. CMD: The actual command that will be executed.

Let's use the example of backing up files. You may wish to backup "cmnatic" 's "Documents" every 12 hours.

We would use the following formatting:

"0 *12 * * * cp -R /home/cmnatic/Documents  /var/backups/"

An interesting feature of crontabs is that these also support the wildcard or asterisk (*). If we do not wish to provide a value for that specific field, i.e. we don't care what month month, day, or year it is executed -- only that it is executed every 12 hours, we simply just place an asterisk. 

This can be confusing to begin with, which is why there are some great resources such as the online "Crontab Generator" that allows you to use a friendly application to generate your formatting for you. As well as the site "Cron Guru"

Crontabs can be edited by using "crontab -e", where you can select an editor to edit your crontab file. 

https://assets.tryhackme.com/additional/linux-fundamentals/part3/cron2.png

https://assets.tryhackme.com/additional/linux-fundamentals/part3/cron3.png
------------------------------------------------------------------------------------------------------
2. Package Management
------------------------------------------------------------------------------------------------------
- Introducing Packages & Software Repos
----------------------------------------------------
When deelopers wish to submit software to the community, they will submit it to an "apt" repository. If approved, their programs and tools will be released into the wild world. Two of the most redeeming features of Linux shine to light here: User accessibility and the merit of open source tools. 

When using the ls command on a Ubuntu 20.04 Linux machine, these files serve as the gateway/registry. 

https://assets.tryhackme.com/additional/linux-fundamentals/part3/apt1.png
https://assets.tryhackme.com/additional/linux-fundamentals/part3/apt2.png

Whilst Operating System vendors will maintain their own repositories, you can also add community repositories to your list. This allows you to extend the capabilities of your OS. Additional repositories can be added by using the "add-apt-repository" command or by listing another provider.

For example: some vendors will have a repository that is closer to their geographical location.

-------------------------------------------------------------------
- Managing your repositories (Adding and Removing)
--------------------------------------------------------------------
Normally we use the "apt" command to install software onto our ubuntu/debian system. The "apt" command is a part of the package management software also named apt. 

Apt contains a whole suite of tools that allows us to manage the packages and source of our software, and to install or remove software at the same time.

Let's walk through adding and removing a repository using the "add-apt-repository" command we illustrated above. Whilst you can install software through the use of package installers such as "dpkg", the benefits of apt means that whenever we update our system -- the repository that contains the pieces of software that we add also gets checked for updates. 

In this example, we are going to add the text editor sublime text to our Ubuntu machine as a repository as it is not a part of the default Ubuntu repositories. When adding software, the integrity of what we download is guaranteed by the use of what is called GPG (Gnu Privacy Guard) Keys. 

These keys are essentially a safety check from the developers saying, 'here is our software'. If the keys do not match up to what your system trusts and what the developers used, then the software will not be downloaded. 

So, to start, we need to add the GPG key for the developers of Sublime Text 3.

1. Let's download the GPG key and use apt-key to trust it: 

"wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -"

2. Now that we have added this key to our trusted list, we can now add Sublime Text 3's repository to our apt sources list. A good practice is to have a separate file for every different community/3rd party repository that we add. 

2.1 Let's create a file named sublime-text.list in /etc/apt/sources.list.d and enter the repository information like so: 

https://assets.tryhackme.com/additional/linux-fundamentals/part3/sources1.png

2.2 And now use nano or a text editor of your choice to add & save the Sublime Text 3 repository into this newly created file:

"deb https://download.sublimetext.com/ apt/stable/"

2.3 After we have added this entry, we need to update apt to recognize this new entry -- this is done using the "apt update" command

2.4 Once successfully updated, we can now proceed to install the software that we have trusted and added to apt using "apt install sublime-text" 

Removing packages is as easy as reversing. This process is done by using the: "add-apt-repository --remove ppa:PPA_Name/ppa" command or by manually deleting the file that we previously fulfilled. Once removed, we can just use apt remove [software-name-here] i.e. "apt remove sublime-text"
------------------------------------------------------------------------------------------------------
3. Logs
------------------------------------------------------------------------------------------------------
We briefly touched upon log files and where they can be found in Linux. However, let's quickly recap. Located in the /var/log directory. these files and folders contain logging information for applications and services running on your system. The Operating System (OS) has become pretty good at automatically managing these logs in a process that is known as "rotating".

I have highlighted some logs from three services running on a Ubuntu machine: 
- An Apache2 web server 
- Logs for the fail2ban service, which is used to monitor attempted brute forces.
- The UFW service which is used as a firewall 


https://assets.tryhackme.com/additional/linux-fundamentals/part3/log1.png

These services and logs are a great way in monitoring the health of your system and protecting it. Not only that, but the logs for services such as a web server contain information about every single request - allowing developers or administrators to diagnose performance issues or investigate an intruder's activity. For example, the two types of log files below that are of interest: 
- access log
- error log
https://assets.tryhackme.com/additional/linux-fundamentals/part3/log2.png

There are, of course, logs that store information about how the OS is 
running itself and actions that are performed by users, such as authentication attempts. 

OS : Operating System (OS) is a layer between the hardware and the applications. From the application's perspective, the OS provides an interface to access the different hardware components, such as CPU, RAM, and disk storage. Examples of OS are Android, FreeBSD, Linux, macOS, and Windows.
------------------------------------------------------------------------------------------------------

Processes 101

------------------------------------------------------------------------------------------------------

- Processes are the programs that are running on your machine. 

- They are managed by the kernel, where each process will have an ID associated with it, also known as its PID.

- The PID increments for the order In which the process starts. I.e. the 60th process will have a PID of 60.

-----------------------------------------------------------------------------------------------------------------------------
Viewing Processes
-------------------------
We can use the friendly "ps" command to provide a list of the running processes as our user's session and some additional information such as its status code, the session that is running it, how much usage time of the CPU it is using, and the name of the actual program or command that is being executed.
----------------------------------------------------------------------------------------------
To see the processes run by other users and those that don't run from a session (i.e. system processes), we need to provide "aux" to the "ps" command : "ps aux"
-----------------------------------------------------------------------------------------------------------------------------
* Another very useful command is the "top" command

- "top" gives you real-time statistics about the processes running on your system instead of a one-time view. (Live)

- These statistics will refresh every 10 seconds, but will also refresh when you use the arrow keys to browse the various rows.

https://assets.tryhackme.com/additional/linux-fundamentals/part3/top1.png
-----------------------------------------------------------------------------------------------------------------------------
Managing Processes
-------------------------
- You can send signals that terminate processes
- There are a variety of types of signals that correlate to exactly how "cleanly" the process is dealt with by the kernel. 
------------------------------------
* To kill a command, we can use the appropriately named kill command and the associated PID that we wish to kill.

example: kill 1337
------------------------------------
* the signals that we can send to a process when it is killed

1. SIGTERM - Kill the process, but allow it to do some cleanup tasks beforehand

2. SIGKILL - Kill the process - doesn't do any cleanup after the fact

3. SIGSTOP - Stop/suspend a process
-----------------------------------------------------------------------------------------------------------------------------
How do Processes Start?
------------------------------

Let's start off by talking about namespaces. The Operating System (OS) uses namespaces to ultimately split up the resources available on the computer to (such as CPU, RAM and priority) processes. Think of it as splitting your computer up into slices -- similar to a cake. Processes within that slice will have access to a certain amount of computing power, however, it will be a small portion of what is actually available to every process overall.

Namespaces are great for security as it is a way of isolating processes from another -- only those that are in the same namespace will be able to see each other.

We previously talked about how PID works, and this is where it comes into play. The process with an ID of 0 is a process that is started when the system boots. This process is the system's init on Ubuntu, such as systemd, which is used to provide a way of managing a user's processes and sits in between the operating system and the user. 

For example, once a system boots and it initialises, systemd is one of the first processes that are started. Any program or piece of software that we want to start will start as what's known as a child process of systemd. This means that it is controlled by systemd, but will run as its own process (although sharing the resources from systemd) to make it easier for us to identify and the likes.

https://assets.tryhackme.com/additional/linux-fundamentals/part3/process1.png

-----------------------------------------------------------------------------------------------------------------------------
Getting Processes/Services to Start on Boot
-----------------------------------------------------
Some applications can be started on the boot of the system that we own. For example, web servers, database servers or file transfer servers. This software is often critical and is often told to start during the boot-up of the system by administrators.

In this example, we're going to be telling the apache web server to be starting apache manually and then telling the system to launch apache2 on boot.

Enter the use of systemctl -- this command allows us to interact with the systemd process/daemon. Continuing on with our example, systemctl is an easy to use command that takes the following formatting: systemctl [option] [service]

For example, to tell apache to start up, we'll use systemctl start apache2. Seems simple enough, right? Same with if we wanted to stop apache, we'd just replace the [option] with stop (instead of start like we provided)

We can do four options with systemctl:

Start
Stop
Enable
Disable
-----------------------------------------------------------------------------------------------------------------------------
An Introduction to Backgrounding and Foregrounding in Linux
-----------------------------------------------------------------------------
Processes can run in two states: In the background and in the foreground. For example, commands that you run in your terminal such as "echo" or things of that sort will run in the foreground of your terminal as it is the only command provided that hasn't been told to run in the background. "Echo" is a great example as the output of echo will return to you in the foreground, but wouldn't in the background - take the screenshot below, for example.

https://assets.tryhackme.com/additional/linux-fundamentals/part3/bg1.png

Here we're running echo "Hi THM" , where we expect the output to be returned to us like it is at the start. But after adding the & operator to the command, we're instead just given the ID of the echo process rather than the actual output -- as it is running in the background.

This is great for commands such as copying files because it means that we can run the command in the background and continue on with whatever further commands we wish to execute (without having to wait for the file copy to finish first)

We can do the exact same when executing things like scripts -- rather than relying on the & operator, we can use Ctrl + Z on our keyboard to background a process. It is also an effective way of "pausing" the execution of a script or command like in the example below:

https://assets.tryhackme.com/additional/linux-fundamentals/part3/bg2.png

This script will keep on repeating "This will keep on looping until I stop!" until I stop or suspend the process. By using Ctrl + Z (as indicated by T^Z). Now our terminal is no longer filled up with messages -- until we foreground it, which we will discuss below.
-----------------------------------------------------------------------------------------------------------------------------
Now that we have a process running in the background, for example, our script "background.sh" which can be confirmed by using the ps auxcommand, we can back-pedal and bring this process back to the foreground to interact with.

https://assets.tryhackme.com/additional/linux-fundamentals/part3/bg3.png

With our process backgrounded using either Ctrl + Z or the & operator, we can use fg to bring this back to focus like below, where we can see the fg command is being used to bring the background process back into use on the terminal, where the output of the script is now returned to us.

https://assets.tryhackme.com/additional/linux-fundamentals/part3/bg4.png

https://assets.tryhackme.com/additional/linux-fundamentals/part3/bg5.png

-----------------------------------------------------------------------------------------------------------------------------

Terminal Text Editors

-----------------------------------------------------------------------------------------------------------------------------
Nano
----------------
- usage: nano filename -- replacing "filename"  with the name of the file you wish to edit.

- You can navigate each line using the "up" and "down" arrow keys or start a new line using the "Enter" key on your keyboard.

- nano has a few features that covers the most general things a user would want out of a text editor

1. Searching for text
2. Copying and Pasting
3. Jumping to a line number
4. Finding out what line number you are on

These features can be used by pressing the "Ctrl" key (whis is represented as an ^ on Linux ) and a corresponding letter.

some of them : 

Ctrl+G Open nano to help screen
Ctrl+X Exit nano or close currrent buffer
Ctrl+O Save currently open file
Ctrl+J Justify current paragraph
Ctrl+R Insert another file into the current one
Ctrl+W Search the file
Ctrl+K Cut the currently selected line
Ctrl+U Paste the line that was cut
Ctrl+C Dsiplay the cursor positions

... etc 
----------------------------------------------------------------------------------------
Vim/Vi
----------------
- VIM is a much more advanced text editor.

https://assets.tryhackme.com/additional/linux-fundamentals/part3/vim1.png

Some of VIM's benefits:

1. Customisable - you can modify the keyboard shortcuts to be of your choosing

2. Syntax Highlighting - this is useful if you are writing or maintaining code, making it a popular choice for software developers

3. VIM works on all terminals where nano may not be installed

4. There are a lot of resources such as cheatsheets, tutorials, and the sorts available to you use.

----------------------------------------------------------------------------------------
Basic Vim commands => 

:help [keyword] - Performs a search of help documentation for whatever keyword you enter

:e [file] - Opens a file, where [file] is the name of the file you want opened

:w - Saves the file you are working on

:w [filename] - Allows you to save your file with the name you've defined

:wq - Save your file and close Vim

:q! - Quit without first saving the file you were working on
----------------------------------------------------------------------------------------
---------
for more. 

----------------------------------------------------------------------------------------
Thank you so much for reading.
That was a long one 🙂

Roger

Comments

Popular posts from this blog

Common Network Commands: Ping

Common Network Commands: Route

John The Ripper