Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How can I clear the output of history command, ctrl+l clears the screen not the output of history command, so is there anyway that history command does not show the previously executed commands.
And also please let me know how I can kill Zoombie processes.
to clear all the history entries. Regarding the zombie processes, they are child processes whose parent does not receive notification about their fate anymore. The only way to kill them (without rebooting) is to quit or kill the parent process. To verify the hierarchy of the processes, you can try the command
Code:
ps -eO user -H
find the processes in a <defunct> status and quit or kill their parent (if possible).
... Regarding the zombie processes, they are child processes whose parent does not receive notification about their fate anymore. The only way to kill them (without rebooting) is to quit or kill the parent process. To verify the hierarchy of the processes, ..
Almost, but not quite. The parent is sent a SIGCHLD when the child dies/exits. The parent must perform a wait() system call to collect the child's status. The defunct zombie process contains essentially that status, but little more; resources have been freed. The signal is sent; the parent may or may not handle the signal, and may or may not reap the child's status. When a parent exits before handling its children via wait(), the init process inherits the child status and usually cleans up properly.
Go to your home directory and type this in terminal
echo > .bash_history
This will delete the history that will be loaded when the next shell starts, but exiting the current shell will place its current history list back into the file.
The key point is that there is both an in core history for each shell process, and on disk history loaded by newly started shells. Unsetting the HISTFILE shell variable will prevent saving to .bash_history. And preceding a command with a space will prevent that command from entering the history (if HISTCONTROL is set to ignorespace). See the variables in man bash that start with HIST.
I used the command in bash prompt as
bash#ps -eO root -H
illegal option --H
what's the mistake I m doing & was that alphabet "O" in caps or digit Zero (0) .
It is the alphabet o uppercase, but you can't use "root" as argument. Here "user" is a keyword. If in your version of ps the -H option is not valid, you can try -f instead.
Best keep to one topic per thread, else we gets confuzzled.
What is "the history command" that you want o clear the output from? The answers you've been given tell you how to clear the file that records the history but I'm not sure that's what you were asking for.
If you get an old command on your screen, typically by using the up arrow, you can get rid of it by Ctrl+C.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.