Windows 11 install Ubuntu 22.04 uses Ubuntu common commands

1. Installing Ubuntu 22.04 on Windows 11

  • Using Windows Subsystem for Linux (WSL)
    • Enable WSL: First, you need to enable the Windows Subsystem for Linux feature. Open “PowerShell” as an administrator and run the command wsl --install. This will download and install the necessary components for running Linux distributions.
    • Download Ubuntu 22.04: After enabling WSL, you can download the Ubuntu 22.04 distribution from the Microsoft Store. Search for “Ubuntu 22.04” in the store and click “Install”.
    • Initial Setup: Once the installation is complete, launch Ubuntu from the Start menu. You’ll be prompted to create a user account and password for your Ubuntu environment.
  • Using a Virtual Machine (VM)
    • Choose a Virtual Machine Software: You can use software like VirtualBox or VMware Workstation. Download and install the virtual machine software of your choice.
    • Create a New Virtual Machine: In the virtual machine software, create a new virtual machine. You’ll need to specify the amount of RAM, the number of CPUs, and the disk space for the Ubuntu installation. For example, you might allocate 2GB of RAM and 20GB of disk space for a basic Ubuntu setup.
    • Install Ubuntu: Insert the Ubuntu 22.04 ISO image into the virtual machine’s optical drive (you can download the ISO from the Ubuntu official website). Boot the virtual machine and follow the on – screen installation instructions to install Ubuntu.

2. Commonly Used Ubuntu Commands

  • cp (Copy Files and Directories)
    • Basic Syntax: The cp command is used to copy files and directories. The basic syntax is cp [options] source destination. For example, to copy a file named file.txt from the current directory to a directory called backup, you can use the command cp file.txt backup/.
    • Options: Some useful options include -r or -R (recursive copy). If you want to copy a directory and all its contents, you need to use this option. For example, to copy a directory mydir to another location newdir, you can use the command cp -r mydir newdir.
  • mv (Move or Rename Files and Directories)
    • Basic Syntax: The mv command can be used to move files or directories from one location to another or to rename them. The basic syntax is mv [options] source destination. For example, to move a file oldfile.txt to a new directory newdir, you can use the command mv oldfile.txt newdir/. To rename a file, you can use the command like mv oldname.txt newname.txt.
    • Options: There are not as many options for mv as for some other commands. One option to note is -i which stands for “interactive”. If you use this option and the destination file already exists, the command will prompt you before overwriting it.
  • rm (Remove Files and Directories)
    • Basic Syntax: The rm command is used to delete files and directories. The basic syntax for deleting a file is rm [options] file. For example, to delete a file unwanted.txt, you can use the command rm unwanted.txt.
    • Options: To delete a directory and all its contents, you need to use the option -r (recursive). However, be very careful when using rm -r as it can permanently delete a large amount of data. For example, to delete a directory olddir and everything in it, you can use the command rm -r olddir.
  • wget (Download Files from the Web)
    • Basic Syntax: The wget command is used to download files from the Internet. The basic syntax is wget [options] URL. For example, if you want to download a file from a website with the URL http://example.com/file.zip, you can use the command wget http://example.com/file.zip.
    • Options: There are many options available. For example, -c allows you to continue a partially downloaded file. If a download is interrupted, you can use wget -c to resume the download from where it left off.
  • ls (List Directory Contents)
    • Basic Syntax: The ls command lists the contents of a directory. The basic syntax is ls [options] [directory]. For example, if you just type ls in the terminal, it will list the contents of the current directory. You can also specify a directory, such as ls /home/user/.
    • Options: Some useful options include -l which gives a long – format listing. This shows more details such as file permissions, owner, size, and modification date. Another option is -a which lists all files, including hidden files (files that start with a dot in Linux).
  • cd.. (Change Directory – Move Up One Level)
    • Explanation: The cd command is used to change directories. The cd.. specifically means moving up one level in the directory hierarchy. For example, if you are in a directory /home/user/documents and you run the command cd.., you will move to the /home/user directory.
  • mkdir (Make Directory)
    • Basic Syntax: The mkdir command is used to create new directories. The basic syntax is mkdir [options] directory - names. For example, to create a new directory called newfolder in the current directory, you can use the command mkdir newfolder.
    • Options: An option like -p can be useful. If you want to create a directory hierarchy (for example, a directory inside another directory), and the parent directories don’t exist, using mkdir -p will create all the necessary parent directories. For example, to create a directory /home/user/projects/newproject and the /home/user/projects directory doesn’t exist, you can use the command mkdir -p /home/user/projects/newproject.

Comments

Leave a Reply