Skip to content

Instantly share code, notes, and snippets.

@syreal17
Created February 20, 2020 17:42
Show Gist options
  • Select an option

  • Save syreal17/8b4bdf7bd0b35a7196b73c02c31c0ec2 to your computer and use it in GitHub Desktop.

Select an option

Save syreal17/8b4bdf7bd0b35a7196b73c02c31c0ec2 to your computer and use it in GitHub Desktop.
pico Primer for Competitors - Shell Chapter - Got Shell? Section
Q.3: What does `~` mean?
A.3: The shell is parked in Q0h313th's home directory which can be accessed by `~` on the computer called `pico-2019-shell1`
Note: the full path for `~` can be expanded to `/home/Q0h313th/`
@deondon

deondon commented Dec 11, 2021

Copy link
Copy Markdown

"~" is called a tilde in English.

@DonatienNtezy

Copy link
Copy Markdown

is "~" the same as directory path ?

@soldier0x00

Copy link
Copy Markdown

@DonatienNtezy you can consider that as a shortcut to "home" directory. No matter which directory you are in, instead of traversing full path front and back, you can just give ~ to come directly to /home/Q0h313th/ as the author syreal17 mentioned.

@sj-on

sj-on commented Mar 6, 2022

Copy link
Copy Markdown

is "~" the same as directory path ?

no. it is only for home/ path. directory path will differ, based on how "in-depth" you are in the folder hierarchical structure.

@Abusaddik

Copy link
Copy Markdown

"~" mean is a directory Parth that can take you back to your home list or director Parth that have used/open

@CyberSuy

Copy link
Copy Markdown

So "~" is the equivalent to home directory. Therefore, cd ~ should bring you back to the /home/Q0h313th/ directories?

@MalcolmAnderson

Copy link
Copy Markdown

Yes, the following 2 command produce the same result, bringing you to your home directory
cd
cd ~

@Srinivasgaraga

Copy link
Copy Markdown

~ it is called tildi it used as a shortcut form root/home directories

ghost commented Dec 29, 2022

Copy link
Copy Markdown

~ is called a tilde.
It's equivalent to the home directory: /home/Q0h313th/

@praksh134

Copy link
Copy Markdown

~ means now the shell is having the home directory

@Parcehack

Copy link
Copy Markdown

is a directory

@FreeFelix

Copy link
Copy Markdown

"~" When we use it in shell or terminal as a command, It takes us directly in home directory.

@Stackzo

Stackzo commented Sep 8, 2024

Copy link
Copy Markdown

Are we suppose to know what a directory or in home directory is at this point already? Im confused sorry

@syreal17

Copy link
Copy Markdown
Author

Are we suppose to know what a directory or in home directory is at this point already? Im confused sorry

Directories are covered more later in the chapter, especially in the walkthrough where you create them and change into them. A directory is just a folder that can contain files or more directories.

@rexer01

rexer01 commented Sep 24, 2024

Copy link
Copy Markdown

got it, it´s like a pipe, only for the home directory or this pipe could be setting for redirected to anothe directory ? thanks by the way.

@syreal17

Copy link
Copy Markdown
Author

got it, it´s like a pipe, only for the home directory or this pipe could be setting for redirected to anothe directory ? thanks by the way.

It's different than a pipe. A pipe is an operator that connects the output of one program to the input of another.

Tilde is shorthand for the path to your home directory.

@ArduinoAficionado

Copy link
Copy Markdown

:)

@AnsarulHaq786

Copy link
Copy Markdown

got it, it´s like a pipe, only for the home directory or this pipe could be setting for redirected to anothe directory ? thanks by the way.

It's different than a pipe. A pipe is an operator that connects the output of one program to the input of another.

Tilde is shorthand for the path to your home directory.

yeah.
and similarly "cd /" will take you to the root directory

@xmass890

Copy link
Copy Markdown

"~" tilde is the convection for home directory , but that part show the present working directory

@GauravJain1008

Copy link
Copy Markdown

tilde

@jgh-1

jgh-1 commented Feb 8, 2025

Copy link
Copy Markdown

"~" is called a tilde in English.

Yes it is lol

@sidhu1512

Copy link
Copy Markdown

ok Tilde

@gandyIT

gandyIT commented Aug 21, 2025

Copy link
Copy Markdown

is it possible to customize it to another location?

@syreal17

Copy link
Copy Markdown
Author

is it possible to customize it to another location?

Yes, that would be called changing your home directory which is certainly possible, but not really recommended as there can be a lot of config and settings in your current home directory to manually copy over.

@4Batul

4Batul commented Sep 15, 2025

Copy link
Copy Markdown

"~" is called a tilde in English.

Thanks

@ANK-369

ANK-369 commented Feb 4, 2026

Copy link
Copy Markdown

so, after reading the answer and some of the comments, i think ~ is just another name for home (which is actually your username folder).
if you see only ~ it means you're currently inside your home directory.
if you see another name like ~/Downloads it means you're in that folder inside your home

@TheMLEngineer

Copy link
Copy Markdown

Home dir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment