Score:0

How can I change source directory from System 32?

cz flag

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.

Pilot6 avatar
cn flag
Can you add some details? In Ubuntu the default directory is `/home/$USER`.
Jihane El Jbari avatar
cz flag
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 !
cocomac avatar
cn flag
@JihaneElJbari In that terminal, please [edit] your question to include the output of typing in `cmd.exe` and pressing enter.
Jihane El Jbari avatar
cz flag
@cocomac : done
cocomac avatar
cn flag
So… that is not Ubuntu. That is Windows.
Score:3
cn flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.