0

I am a newbie in Ubuntu. When I open my terminal, the source path (directory) starts with System32, how can I change it to User or Desktop ? When I type cmd.exe : Microsoft Windows [version 10.0.19042.1320] (c) Microsoft Corporation. Tous droits réservés.

5
  • 2
    Can you add some details? In Ubuntu the default directory is /home/$USER.
    – Pilot6
    Commented Oct 31, 2021 at 20:40
  • 1
    Yes sure! when I open my terminal the first I see is "System 32" while other colleagues have "User" or "Desktop". I have just now used "cd" command and I am in /home/user. But when i use "ls" i see "Code" in blue, but I don't see any folders. I would just like to have user or desktop when I open the terminal.. Sorry if my question is unclear and thank you for your reply ! Commented Oct 31, 2021 at 20:50
  • @JihaneElJbari In that terminal, please edit your question to include the output of typing in cmd.exe and pressing enter.
    – cocomac
    Commented Oct 31, 2021 at 21:23
  • @cocomac : done Commented Oct 31, 2021 at 21:33
  • 1
    So… that is not Ubuntu. That is Windows.
    – cocomac
    Commented Oct 31, 2021 at 22:19

1 Answer 1

3

So... Windows is an operating system. Ubuntu is also an operating system. Both are operating systems, but they are different operating systems. They both have shells (see here for the difference between a terminal emulator and a shell). On Windows 10, there are two shells: PowerShell* and cmd.exe. PowerShell can do almost everything cmd.exe can, as it is far newer. There are several shells on Ubuntu. The one that it uses by default for a user is called bash. There is a second one called sh, but it is used less, as it is far less powerful, but it is more cross-platform, similar to how PowerShell is newer, but there are also a few old systems that don't have it.

On Windows, when you start a "Command Prompt" (which is just the start menu entry for cmd.exe). The default directory that cmd.exe (or I think PowerShell, too) is C:\Windows\System32.

Here's the interesting bit: In cmd.exe, to list files in a directory, you type in dir and press enter. On PowerShell, you type in Get-ChildItem, and press enter. Here's where it is confusing: there are a handful of aliases in PowerShell (you can get a list with Get-Alias). The two that matter here are dir and ls. Both are aliased to Get-ChildItem. This means that when you type in ls in PowerShell, it will print the files in the current directory. On Ubuntu, both dir and ls, also print the files in the current directory.

Here's how I know you are using PowerShell on Windows 10:

You mentioned as a comment that ls worked (e.g., it listed the files in your current directory). Remember, ls only works in PowerShell and bash (so not cmd.exe). But, you also said cmd.exe does something: it starts the cme.exe shell. But that only exists on Windows, not Ubuntu.

Now to answer your question:

On both Windows and Linux, you can change your current directory with the cd command. So basically, set your directory with cd [where you want to go]. E.g., on Linux, if you wanted to go to the /etc directory, you would do cd /etc. But if you want Ubuntu, either use something like Windows Subsystem for Linux or download it from the Ubuntu website

*Technically, yes, you can install PowerShell on Linux. But I'm talking about the defaults here.

Not the answer you're looking for? Browse other questions tagged .