SSH,输入命令但它没有执行,无法输入任何内容

时间:2021-07-09 01:03:45

I used the command tar -x file.tar.gz and, for one reason or anything it failed. Then I get stuck being able to type anything in, but not being able to run any more commands. Pressing enter just gives me a new line. I don't know how to break out of it either (escape etc doesn't work). The only way I can get back working is to close putty and reconnect.

我使用命令tar -x file.tar.gz,出于某种原因或任何原因它失败了。然后我卡住了能够输入任何内容,但无法再运行任何命令。按回车只给我一个新线。我不知道如何突破它(逃避等不起作用)。我能够恢复工作的唯一方法是关闭腻子并重新连接。

Is there a way to get it back to normal so I can keep going because it's irritating closing it all the time.

有没有办法让它恢复正常,所以我可以坚持下去,因为它总是令人恼火。

6 个解决方案

#1


Try hitting CTRL+C :) This will cancel/kill/stop the running command!

尝试按CTRL + C :)这将取消/终止/停止正在运行的命令!

But the best way to untar is to use -v to verbose the output :

但是解压缩的最好方法是使用-v来详细输出:

tar -zxvf yourfile.tar.gz

With that, you'll perhaps see that your file just take more time than you thought unarchiving ;)

有了这个,你或许会发现你的文件花费的时间比你想象的还要多;)

#2


Ctrl-C can be used to send a break to the executable that's hanging, but it's up to the application to handle it. Ctrl-Z will break you out of the running executable, but you'll need to then manually kill the process.

Ctrl-C可用于向挂起的可执行文件发送中断,但由应用程序来处理它。 Ctrl-Z将使您脱离正在运行的可执行文件,但您需要手动终止该进程。

What you're doing wrong is you're not gunzipping the archive.

你做错了什么是你没有枪杀档案。

Try this

tar -zxf file.tar.gz

tar -zxf file.tar.gz

#3


If you want to quit it, press CTRL+c. If you want to keep it but being able to write more commands while it's working, press CTRL+z and bg. Then it will work in the background.

如果要退出,请按CTRL + c。如果你想保留它但能够在它工作时编写更多命令,请按CTRL + z和bg。然后它将在后台工作。

#4


Your command failed because it is trying to read stdin. This is because you never told it the name of the tar file with an "f" option.

您的命令失败,因为它正在尝试读取标准输入。这是因为你从未告诉它带有“f”选项的tar文件的名称。

#5


A good Idea would be to use GNU screen. That way, when a command hangs, you can open another screen and take a look at the system (e.g. top to see if tar is still working) or you could kill the process by pressing (strg+a) + k to hard-kill the running process within the screen-session. Screen also has the nice feature that your processes keep running even though your SSH-connection died. It's a lifesaver!

一个好主意是使用GNU屏幕。这样,当一个命令挂起时,你可以打开另一个屏幕并查看系统(例如top以查看tar是否仍在工作)或者你可以通过按(strg + a)+ k来杀死该进程屏幕会话中的运行过程。屏幕还具有很好的功能,即使SSH连接中断,您的进程仍会继续运行。这是一个救星!

#6


Your tar invocation is waiting for input on the command line as the others pointed out. You may also use Ctrl-D to indicate EOF to the tar process.

您的tar调用正在等待命令行上的输入,正如其他人指出的那样。您也可以使用Ctrl-D向tar进程指示EOF。

#1


Try hitting CTRL+C :) This will cancel/kill/stop the running command!

尝试按CTRL + C :)这将取消/终止/停止正在运行的命令!

But the best way to untar is to use -v to verbose the output :

但是解压缩的最好方法是使用-v来详细输出:

tar -zxvf yourfile.tar.gz

With that, you'll perhaps see that your file just take more time than you thought unarchiving ;)

有了这个,你或许会发现你的文件花费的时间比你想象的还要多;)

#2


Ctrl-C can be used to send a break to the executable that's hanging, but it's up to the application to handle it. Ctrl-Z will break you out of the running executable, but you'll need to then manually kill the process.

Ctrl-C可用于向挂起的可执行文件发送中断,但由应用程序来处理它。 Ctrl-Z将使您脱离正在运行的可执行文件,但您需要手动终止该进程。

What you're doing wrong is you're not gunzipping the archive.

你做错了什么是你没有枪杀档案。

Try this

tar -zxf file.tar.gz

tar -zxf file.tar.gz

#3


If you want to quit it, press CTRL+c. If you want to keep it but being able to write more commands while it's working, press CTRL+z and bg. Then it will work in the background.

如果要退出,请按CTRL + c。如果你想保留它但能够在它工作时编写更多命令,请按CTRL + z和bg。然后它将在后台工作。

#4


Your command failed because it is trying to read stdin. This is because you never told it the name of the tar file with an "f" option.

您的命令失败,因为它正在尝试读取标准输入。这是因为你从未告诉它带有“f”选项的tar文件的名称。

#5


A good Idea would be to use GNU screen. That way, when a command hangs, you can open another screen and take a look at the system (e.g. top to see if tar is still working) or you could kill the process by pressing (strg+a) + k to hard-kill the running process within the screen-session. Screen also has the nice feature that your processes keep running even though your SSH-connection died. It's a lifesaver!

一个好主意是使用GNU屏幕。这样,当一个命令挂起时,你可以打开另一个屏幕并查看系统(例如top以查看tar是否仍在工作)或者你可以通过按(strg + a)+ k来杀死该进程屏幕会话中的运行过程。屏幕还具有很好的功能,即使SSH连接中断,您的进程仍会继续运行。这是一个救星!

#6


Your tar invocation is waiting for input on the command line as the others pointed out. You may also use Ctrl-D to indicate EOF to the tar process.

您的tar调用正在等待命令行上的输入,正如其他人指出的那样。您也可以使用Ctrl-D向tar进程指示EOF。