How do I bring back the command prompt ($)

Hi, I did some searching and can’t find this question already answered. So, occasionally I’ll type something wrong and the command prompt will disappear. I’ve tried just typing $ and then a space and then the command and that does not work. Other than refreshing and losing all my work, is there a way to bring it back?

depends on how you mess it up. If you forgot to close a string for example:

echo 'hello world

you will see a > on the next line. you can close the string, or send an interrupt signal (ctrl + c). Can also be a missing bracket, or something else.

then there are tools like less which require you to press q.

ideally you should include a screenshot when you have this problem

what operating system (OS) or command line/prompt are you using?

3 Likes

Windows, and the one in the Athletica project under Redirecting Input and Output. Anyways, ctrl+c worked for me, I had just really messed up a command, and hit enter, and the command prompt was just gone. Thanks for the help.

so within a codecademy lesson, so then the command line is very likely linux

No screenshot? Just gone is very vague. Wouldn’t it be nice to get the root cause of this?

Sorry, once I saw Ctrl+C worked I finished the task and moved on so a screenshot isn’t going to be doable. I basically had a brain spasm and forgot how to do a grep command and just entirely left out the filename, hit enter, and thus what I explained above.

$ pwd
/home/ccuser/workspace/athletica
$ ls -la
total 56
drwxr-xr-x 2 ccuser ccuser 259 Jun 23 04:18 .
drwxrwxr-x 1 ccuser ccuser 23 Jun 23 04:18 …
-rw-r–r-- 1 ccuser ccuser 102 Jun 23 04:18 badminton.txt
-rw-r–r-- 1 ccuser ccuser 97 Jun 23 04:18 basketball.txt
-rw-r–r-- 1 ccuser ccuser 161 Jun 23 04:18 cricket.txt
-rw-r–r-- 1 ccuser ccuser 6148 Mar 5 2016 .DS_Store
-rw-r–r-- 1 ccuser ccuser 304 Jun 23 04:18 equipment.txt
-rw-r–r-- 1 ccuser ccuser 117 Jun 23 04:18 football.txt
-rw-r–r-- 1 ccuser ccuser 393 Jun 23 04:18 games.txt
-rw-r–r-- 1 ccuser ccuser 130 Jun 23 04:18 gymnastics.txt
-rw-r–r-- 1 ccuser ccuser 163 Jun 23 04:18 hockey.txt
-rw-r–r-- 1 ccuser ccuser 159 Jun 23 04:18 lacrosse.txt
-rw-r–r-- 1 ccuser ccuser 605 Jun 23 04:18 roster.txt
-rw-r–r-- 1 ccuser ccuser 69 Jun 23 04:18 swimming.txt
-rw-r–r-- 1 ccuser ccuser 160 Jun 23 04:18 tennis.txt
$ cat basketball.txt
Basketball is a sport played by two teams of five players on a rectangular court. Src: Wikipedia
$ cat hockey.txt
Hockey is a family of sports in which two teams play against each other by trying to maneuver a ball into the opponent’s goal using a hockey stick. Src: Wikipedia
$ cat basketball.txt > hockey.txt
$ cat hockey.txt
Basketball is a sport played by two teams of five players on a rectangular court. Src: Wikipedia
$ cat lacrosse.txt
Lacrosse is a contact team sport played between two teams using a small rubber ball and a long-handled stick called a crosse or lacrosse stick. Src: Wikipedia
$ cat lacrosse.txt >> tenis.txt
$ cat tennis.txt
Tennis is a racket sport that can be played individually against a single opponent (singles) or between two teams of two players each (doubles). Src: Wikipedia
$ cat < gymnastics.txt
Gymnastics is a sport involving the performance of exercises requiring strength, flexibility, balance and control. Src: Wikipedia
$ cat equipment.txt
baseball
shuttlecock
shuttlecock
helmet
football
cleats
cleats
cleats
tennis ball
baseball bat
lacrosse stick
hockey stick
hockey stick
hockey stick
tennis racket
cricket bat
cricket bat
cricket bat
goggles
googles
swimming cap
lacrosse ball
hockey puck
sneakers
sneakers
skates
skates
skates
shinguards
$ cat equipment.txt
baseball
shuttlecock
shuttlecock
helmet
football
cleats
cleats
cleats
tennis ball
baseball bat
lacrosse stick
hockey stick
hockey stick
hockey stick
tennis racket
cricket bat
cricket bat
cricket bat
goggles
googles
swimming cap
lacrosse ball
hockey puck
sneakers
sneakers
skates
skates
skates
shinguards
$ sort equipment.txt
baseball
baseball bat
cleats
cleats
cleats
cricket bat
cricket bat
cricket bat
football
goggles
googles
helmet
hockey puck
hockey stick
hockey stick
hockey stick
lacrosse ball
lacrosse stick
shinguards
shuttlecock
shuttlecock
skates
skates
skates
sneakers
sneakers
swimming cap
tennis ball
tennis racket
$ sort equipment.txt | uniq
baseball
baseball bat
cleats
cricket bat
football
goggles
googles
helmet
hockey puck
hockey stick
lacrosse ball
lacrosse stick
shinguards
shuttlecock
skates
sneakers
swimming cap
tennis ball
tennis racket
$ grep Japan roster.txt
Yuki Hayashi, Swimming: Japan
Misako Sato, Gymnastics: Japan
Takumi Fujiwara, Basketball: Japan
Toshi Ogawa, Badminton: Japan
$ grep -R Player .
$ sed .s/loss/win/g’ games.txt