{"id":432,"date":"2024-12-29T17:22:31","date_gmt":"2024-12-29T09:22:31","guid":{"rendered":"https:\/\/silubaba.com.cn\/?p=432"},"modified":"2024-12-29T17:22:32","modified_gmt":"2024-12-29T09:22:32","slug":"windows-11-install-ubuntu-22-04-uses-ubuntu-common-commands","status":"publish","type":"post","link":"https:\/\/silubaba.com.cn\/?p=432","title":{"rendered":"Windows 11 install Ubuntu 22.04 uses Ubuntu common commands"},"content":{"rendered":"\n<iframe loading=\"lazy\" src=\"\/\/player.bilibili.com\/player.html?isOutside=true&#038;aid=1550786535&#038;bvid=BV1ay42187pG&#038;cid=1448421964&#038;p=1\" scrolling=\"no\" border=\"0\" frameborder=\"no\" framespacing=\"0\" allowfullscreen=\"true\"  width=\"1024px\" height=\"768px\"><\/iframe>\n\n\n\n<p><strong>1. Installing Ubuntu 22.04 on Windows 11<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Using Windows Subsystem for Linux (WSL)<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>Enable WSL<\/strong>: First, you need to enable the Windows Subsystem for Linux feature. Open &#8220;PowerShell&#8221; as an administrator and run the command\u00a0<code>wsl --install<\/code>. This will download and install the necessary components for running Linux distributions.<\/li>\n\n\n\n<li><strong>Download Ubuntu 22.04<\/strong>: After enabling WSL, you can download the Ubuntu 22.04 distribution from the Microsoft Store. Search for &#8220;Ubuntu 22.04&#8221; in the store and click &#8220;Install&#8221;.<\/li>\n\n\n\n<li><strong>Initial Setup<\/strong>: Once the installation is complete, launch Ubuntu from the Start menu. You&#8217;ll be prompted to create a user account and password for your Ubuntu environment.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Using a Virtual Machine (VM)<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>Choose a Virtual Machine Software<\/strong>: You can use software like VirtualBox or VMware Workstation. Download and install the virtual machine software of your choice.<\/li>\n\n\n\n<li><strong>Create a New Virtual Machine<\/strong>: In the virtual machine software, create a new virtual machine. You&#8217;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.<\/li>\n\n\n\n<li><strong>Install Ubuntu<\/strong>: Insert the Ubuntu 22.04 ISO image into the virtual machine&#8217;s optical drive (you can download the ISO from the Ubuntu official website). Boot the virtual machine and follow the on &#8211; screen installation instructions to install Ubuntu.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p><strong>2. Commonly Used Ubuntu Commands<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>cp (Copy Files and Directories)<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>Basic Syntax<\/strong>: The\u00a0<code>cp<\/code>\u00a0command is used to copy files and directories. The basic syntax is\u00a0<code>cp [options] source destination<\/code>. For example, to copy a file named\u00a0<code>file.txt<\/code>\u00a0from the current directory to a directory called\u00a0<code>backup<\/code>, you can use the command\u00a0<code>cp file.txt backup\/<\/code>.<\/li>\n\n\n\n<li><strong>Options<\/strong>: Some useful options include\u00a0<code>-r<\/code>\u00a0or\u00a0<code>-R<\/code>\u00a0(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\u00a0<code>mydir<\/code>\u00a0to another location\u00a0<code>newdir<\/code>, you can use the command\u00a0<code>cp -r mydir newdir<\/code>.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>mv (Move or Rename Files and Directories)<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>Basic Syntax<\/strong>: The\u00a0<code>mv<\/code>\u00a0command can be used to move files or directories from one location to another or to rename them. The basic syntax is\u00a0<code>mv [options] source destination<\/code>. For example, to move a file\u00a0<code>oldfile.txt<\/code>\u00a0to a new directory\u00a0<code>newdir<\/code>, you can use the command\u00a0<code>mv oldfile.txt newdir\/<\/code>. To rename a file, you can use the command like\u00a0<code>mv oldname.txt newname.txt<\/code>.<\/li>\n\n\n\n<li><strong>Options<\/strong>: There are not as many options for\u00a0<code>mv<\/code>\u00a0as for some other commands. One option to note is\u00a0<code>-i<\/code>\u00a0which stands for &#8220;interactive&#8221;. If you use this option and the destination file already exists, the command will prompt you before overwriting it.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>rm (Remove Files and Directories)<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>Basic Syntax<\/strong>: The\u00a0<code>rm<\/code>\u00a0command is used to delete files and directories. The basic syntax for deleting a file is\u00a0<code>rm [options] file<\/code>. For example, to delete a file\u00a0<code>unwanted.txt<\/code>, you can use the command\u00a0<code>rm unwanted.txt<\/code>.<\/li>\n\n\n\n<li><strong>Options<\/strong>: To delete a directory and all its contents, you need to use the option\u00a0<code>-r<\/code>\u00a0(recursive). However, be very careful when using\u00a0<code>rm -r<\/code>\u00a0as it can permanently delete a large amount of data. For example, to delete a directory\u00a0<code>olddir<\/code>\u00a0and everything in it, you can use the command\u00a0<code>rm -r olddir<\/code>.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>wget (Download Files from the Web)<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>Basic Syntax<\/strong>: The\u00a0<code>wget<\/code>\u00a0command is used to download files from the Internet. The basic syntax is\u00a0<code>wget [options] URL<\/code>. For example, if you want to download a file from a website with the URL\u00a0<code>http:\/\/example.com\/file.zip<\/code>, you can use the command\u00a0<code>wget http:\/\/example.com\/file.zip<\/code>.<\/li>\n\n\n\n<li><strong>Options<\/strong>: There are many options available. For example,\u00a0<code>-c<\/code>\u00a0allows you to continue a partially downloaded file. If a download is interrupted, you can use\u00a0<code>wget -c<\/code>\u00a0to resume the download from where it left off.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>ls (List Directory Contents)<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>Basic Syntax<\/strong>: The\u00a0<code>ls<\/code>\u00a0command lists the contents of a directory. The basic syntax is\u00a0<code>ls [options] [directory]<\/code>. For example, if you just type\u00a0<code>ls<\/code>\u00a0in the terminal, it will list the contents of the current directory. You can also specify a directory, such as\u00a0<code>ls \/home\/user\/<\/code>.<\/li>\n\n\n\n<li><strong>Options<\/strong>: Some useful options include\u00a0<code>-l<\/code>\u00a0which gives a long &#8211; format listing. This shows more details such as file permissions, owner, size, and modification date. Another option is\u00a0<code>-a<\/code>\u00a0which lists all files, including hidden files (files that start with a dot in Linux).<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>cd.. (Change Directory &#8211; Move Up One Level)<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>Explanation<\/strong>: The\u00a0<code>cd<\/code>\u00a0command is used to change directories. The\u00a0<code>cd..<\/code>\u00a0specifically means moving up one level in the directory hierarchy. For example, if you are in a directory\u00a0<code>\/home\/user\/documents<\/code>\u00a0and you run the command\u00a0<code>cd..<\/code>, you will move to the\u00a0<code>\/home\/user<\/code>\u00a0directory.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>mkdir (Make Directory)<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>Basic Syntax<\/strong>: The\u00a0<code>mkdir<\/code>\u00a0command is used to create new directories. The basic syntax is\u00a0<code>mkdir [options] directory - names<\/code>. For example, to create a new directory called\u00a0<code>newfolder<\/code>\u00a0in the current directory, you can use the command\u00a0<code>mkdir newfolder<\/code>.<\/li>\n\n\n\n<li><strong>Options<\/strong>: An option like\u00a0<code>-p<\/code>\u00a0can be useful. If you want to create a directory hierarchy (for example, a directory inside another directory), and the parent directories don&#8217;t exist, using\u00a0<code>mkdir -p<\/code>\u00a0will create all the necessary parent directories. For example, to create a directory\u00a0<code>\/home\/user\/projects\/newproject<\/code>\u00a0and the\u00a0<code>\/home\/user\/projects<\/code>\u00a0directory doesn&#8217;t exist, you can use the command\u00a0<code>mkdir -p \/home\/user\/projects\/newproject<\/code>.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>1. Installing Ubuntu 22.04 on Windows 11 2. Commonly Used Ubuntu Commands<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-432","post","type-post","status-publish","format-standard","hentry","category-company-news"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/silubaba.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/432","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/silubaba.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/silubaba.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/silubaba.com.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/silubaba.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=432"}],"version-history":[{"count":1,"href":"https:\/\/silubaba.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/432\/revisions"}],"predecessor-version":[{"id":435,"href":"https:\/\/silubaba.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/432\/revisions\/435"}],"wp:attachment":[{"href":"https:\/\/silubaba.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/silubaba.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/silubaba.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}