MoonPoint Support Logo

 

Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
October
Sun Mon Tue Wed Thu Fri Sat
   
15
   
2013
Months
Oct


Tue, Oct 15, 2013 10:40 pm

Deleting a command from your bash history

The bash shell is a commonly used shell on Unix/Linux systems. The history feature which is available with the bash shell is very useful, allowing you to easily recall and reuse previously entered commands without retyping them. E.g., if you had entered a long ssh command with a lot of options, you can simply hit Ctrl-R and type ssh to recall the last ssh command entered. You can then edit the command or simply hit Enter to execute the same command again.

Occasionally, though, you may not want something you've typed at the shell prompt to remain in your history file. E.g., I've occasionally inadvertently typed a password at a point where a password prompt hadn't appeared. You can delete a particular command by using history -d num where num is the number assigned to the command in the history file, which you can see by typing history with no parameters. After deleting the command use history -w to write the update to your ~/.bash_history file to disk. E.g., If I saw that command 245 was showing the password I mistakenly typed, I could use the following commands to ensure that the password couldn't be viewed by anyone who might gain access to the history information:

$ history -d 245
$ history -w

If you wished to delete all the commands stored in the history file, you could use history -c followed by history -w.

[/os/unix/bash] permanent link

Tue, Oct 15, 2013 10:16 pm

Moving a window

On a Ubuntu Linux system, if you need a window from one area of the screen to another, you can use the keyboard shortcut Alt-F7 to move the current window. Once you've entered the keyboard shortcut, a hand icon will appear in the window and you can use the mouse, touchpad, or the cursor keys on the keyboard to move the window about. When you hit Enter, the window will remain at the position to which you've moved it.

[/os/unix/linux/ubuntu] permanent link

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo