"Master Your Ubuntu Terminal: Essential Linux Commands You Need to Know"

"Master Your Ubuntu Terminal: Essential Linux Commands You Need to Know"

Welcome To The World Of Linux

COMMANDS

  1. ADMINSRATIVE ACCESS - Sudo Su

    `Sudo`

    Sudo stands for "superuser do". It allows user to execute a command as another user with root privileges

    `Su`

    Su stands for "substitute user" or "switch user" . This command temporarily allows you act as a different user . It switches the current user to the root user.

    `Sudo su`

    Using sudo su you can effectively manage your linux system with the necessary administrative privileges because you will be operating as a root user.

    Example:

    1. Type sudo su in the terminal

    2. Enter your user password when prompted. When typing in your password it will be invisible

    3. After successful authentication, your command prompt will change (typically from $ to #), indicating that you are now operating as the root user as seen in the Image below

  1. PACKAGE MANAGEMENT - apt update

    Is a system by which software can be installed, updated and queried.

    • Run this command apt update to update package lists for upgrades

    • Run apt upgrade to install the newest versions of all packages currently installed on the system

    • Run apt list --upgradable is to list all packages that have available updates

  1. CHANGE DIRECTORY -Cd

    • Directories are a type of file used to store other files which provide a hierarchical organizational structure. Directories are equivalent to folders on windows

mkdir- Run this command mkdir <name your directory> to create a new directory

cd - Run this command cd <name of directory> to change current directory to "the directory created 'techfolder' as seen in image below with the pointy arrow

cd ~- This command returns you to your home directory

  1. CREATE FILE -touch <"file1.txt", "file2.txt", "file3.txt">

    As the commands shows we created three new empty files

    ls - This command lists the contents of the current directory

    ls -r - This command shows your results in an alphabetical order

    ls -1 - Use this command to verify information in your file. It gives a long display output about files listed

  2. REMOVE FILE (rm) -sudo rm <name of file>

    Deletes "file1.txt" from the current directory with superuser privileges

    • This command is to delete files and directories

    • To remove a directory or delete a directory run command sudo rm -r <name of directory>

  1. MOVING FILE (mv) -mv file3.txt <name of directory>
  • Created a new directory named "cloudfolder"

  • Run the command above to move "file3.txt" into the "cloudfolder" directory

  • Change the current directory to "cloudfolder"

  1. PRINTING WORKING DIRECTORY (pwd) - pwdThis command helps you discover where you are currently located within the file system.

  2. cd .. - To move out of a directory

  1. OPEN TEXT EDITOR -vi <file name>

    vi Opens the "techfolder" directory with the vi editor.

9a. EMPTY TEXT FILE

9b. INPUT YOUR TEXT (Writeup) - Very importantly before you can write, type or use this blank space "Click On" the letter "I" on your PC keyboard

  • To exit press on the "esc" button on your pc keyboard and type":wq"

    and press "enter"

10. FILES (cat) -cat<name of file>

This command displays all the entire contents of the file, recommended for small files

  1. INSTALL VIM TEXT EDITOR - sudo apt install vim

    sudo apt install vim run this command on the terminal and press "Enter". NOTE: You can either use 'vi' or 'vim' as a text editor

11a. SUCCESSFULLY INSTALLED VIM

  1. INPUT TEXT USING `vim` COMMAND - Run command `vim file3.txt' to open up an empty text editor

12a. To begin typing or using space once the blank text area opens, first press the letter "i" on the keyboard.

  • Input text

  • To save and exit "Click On" the "esc" button on your keyboard and type " :wq"

  1. VIEW CONTENT OF THE FILE - Displays the contents of "file3.txt" in the terminal using command cat file3.txt

  2. EXIT - This command exit closes the current terminal session and takes you back to root

  3. CLEAR - This command clears all previous commands and output from the terminal screen, providing a clean workspace

  4. HISTORY - The history command helps you keep track of the commands you’ve executed in the terminal session, which can be useful for recalling complex command sequences or troubleshooting issues.

    LOVE LETTER TO MYSELF!!!!

    CONCLUSION

    Each of these commands is fundamental for managing files, directories, and packages in a Linux environment. They are essential tools for navigating the filesystem, editing text files, and maintaining the system's software