LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   how to exit from command "source" and keep shell window? (https://www.linuxquestions.org/questions/linux-general-1/how-to-exit-from-command-source-and-keep-shell-window-4175651866/)

creatxr 04-10-2019 09:00 AM

how to exit from command "source" and keep shell window?
 
how to exit from command "source" and keep shell window?

if i use "exit" , it will close shell window.

i want to "exit" from "source" , but keep opened shell window.

thanks

petelq 04-10-2019 09:37 AM

Quote:

Originally Posted by creatxr (Post 5983238)
how to exit from command "source" and keep shell window?

if i use "exit" , it will close shell window.

i want to "exit" from "source" , but keep opened shell window.

thanks

Try
Code:

clear
If you've used su - or su to gain root access, then you can use exit to return to standard user.

rtmistler 04-10-2019 09:49 AM

While "clear" will clear the screen for a terminal, or xterm session, CTRL-C will exit an existing program that may be running, which currently stops a terminal from accepting input. One can also use CTRL-Z to break, and then type "bg" to put a running program into the background.

What would be helpful here is a better description of what the exact problem is.

creatxr 04-10-2019 10:58 AM

"clear" and "ctrl+z" not work

that's a python project,

use command "source venv/bin/activate"

and get shell as : "(venv) creatxr@laptop:"

i want to exit from "(venv)"

return to "creatxr@laptop:"

the two commands cannot do that

if i use "exit" command , the shell window will close

sgrlscz 04-10-2019 11:19 AM

Try 'deactivate'.

creatxr 04-10-2019 11:39 AM

Quote:

Originally Posted by sgrlscz (Post 5983295)
Try 'deactivate'.

that's work.

thanks.


All times are GMT -5. The time now is 09:00 AM.