Search

Four Basic Linux Commands Every Beginner Should Know


 


The Linux terminal may look complicated at first, but you only need a few commands to start navigating the system confidently. In this beginner-friendly video, Liko demonstrates four essential Linux commands: pwd, ls, mkdir, and cd.

These commands help you identify your current location, view files and folders, create a new directory, and move between directories.

1. pwd — Find Your Current Location

The pwd command stands for print working directory. It displays the complete path of the directory in which you are currently working.

Enter:

pwd

Example output:

/home/user

You can think of pwd as asking Linux: “Where am I?”

2. ls — View Files and Folders

The ls command lists the files and folders available in your current directory.

Enter:

ls

Example output:

Desktop  Documents  Downloads  Pictures

This command is useful whenever you want to check what is available in a directory before opening, copying or deleting anything.

3. mkdir — Create a New Directory

A directory in Linux is similar to a folder in Windows. The mkdir command stands for make directory.

To create a directory named linux-practice, enter:

mkdir linux-practice

The command normally produces no output when it is successful. Use ls to confirm that the directory was created:

ls

You should now see linux-practice in the list:

Desktop  Documents  Downloads  linux-practice  Pictures

4. cd — Change Directory

The cd command stands for change directory. It allows you to move from your current directory into another directory.

To enter the newly created directory, use:

cd linux-practice

The terminal prompt may change to indicate your new location. You can also verify it using:

pwd

Example output:

/home/user/linux-practice

Practice Exercise

Open a Linux terminal and enter the following commands one at a time:

pwd
ls
mkdir linux-practice
ls
cd linux-practice
pwd

After completing the exercise, you should be able to:

  • Identify your current directory

  • View files and folders

  • Create a new directory

  • Enter the newly created directory

Command Summary

CommandMeaningPurpose
pwdPrint working directoryDisplays your current location
lsListDisplays files and folders
mkdirMake directoryCreates a new directory
cdChange directoryMoves into another directory

Conclusion

These four commands provide a simple foundation for working with the Linux terminal. Once you are comfortable with them, you can proceed to creating files, copying and moving content, deleting files safely, and understanding Linux permissions.

Try the commands yourself instead of only watching the demonstration. Regular practice is the easiest way to become comfortable with the Linux command line.

Next lesson: Creating, copying, moving and deleting files in Linux.

Resolve DNS name in ubuntu

Enabling Active Directory DNS Resolution on Ubuntu

Problem Statement: An Ubuntu VM needs to communicate with several Windows VMs that are members of an Active Directory (AD) domain. While the Windows machines can resolve each other's hostnames via the Domain Controller, the Ubuntu VM fails to resolve these DNS names, preventing seamless connectivity.

Objective: Configure the Ubuntu VM to use the Active Directory Domain Controller (DC) as its primary DNS server for name resolution.

Technical Solution: Updating the Nameserver

To allow Ubuntu to "see" the AD environment, you must point its DNS configuration to the IP address of the Domain Controller.

1. Identify the DNS IP

On any of your Windows VMs already in the domain, find the DNS server IP (usually the IP of your Domain Controller).

2. Update the Configuration

In Linux, DNS resolution is primarily handled by the resolv.conf file. You need to add your AD DNS IP to this file.

  • File Path: /etc/resolv.conf

  • Action: Add a nameserver entry at the top of the file.

Example Entry

nameserver 192.168.1.10  # Replace with your AD DNS IP
search yourdomain.local  # Optional: allows resolution of short names

Modern Ubuntu versions (18.04 and later) use a service called systemd-resolved. If you manually edit /etc/resolv.conf, your changes might be overwritten after a reboot.

For a permanent fix, it is usually better to:

  1. Edit the Netplan configuration in /etc/netplan/.

  2. Or, use systemd-resolved by linking the file:

    ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

  3. Note: If you are in a production environment, ensure that your AD DNS server is also configured to "Forward" requests to a public DNS (like 8.8.8.8) so your Ubuntu VM doesn't lose general internet access while searching for the domain.

Specific Netplan commands to make this DNS change permanent

IF you're working with a modern version of Ubuntu (like 20.04, 22.04, or 24.04), using Netplan is the most reliable way to ensure your DNS settings survive a reboot.

Here is how to apply the fix permanently:

1. Locate your Netplan Configuration

Netplan configuration files are YAML files located in /etc/netplan/. Run this command to find the filename:

ls /etc/netplan/

(Common filenames are 01-netcfg.yaml, 50-cloud-init.yaml, or 00-installer-config.yaml.)

2. Edit the File

Open the file with root privileges (replace filename.yaml with your actual file name):

sudo nano /etc/netplan/filename.yaml

3. Add the DNS/Nameserver Info

Update the nameservers section under your network interface (usually eth0 or ens33). It should look like this:

YAML
network:
  version: 2
  ethernets:
    eth0:
      dhcp4: true
      nameservers:
        addresses: [192.168.1.10, 8.8.8.8] # Your AD DNS IP first, then a backup
        search: [yourdomain.local]         # Your AD Domain name

4. Apply the Changes

Save the file (Ctrl+O, Enter) and exit (Ctrl+X). Then, run:

sudo netplan apply

How to Verify the Fix

Once applied, you can check if Ubuntu is actually talking to your Active Directory DNS by running:

resolvectl status

Look for the "DNS Servers" section under your active interface to confirm your AD IP is listed.