Linked Questions

39
votes
12answers
7k views

best way to search my shell's history

Is there a better way to search my history file for a command than grep? I do have some idea what the command starts as, but I don't know how far back in the history it is. update: was formerly zsh ...
25
votes
15answers
2k views

What customizations have you done on your shell profile to increase productivity?

I know some people have some startup scripts and some people personalise the prompt. One developer uses short aliases for the long path he often visits and the frequent commands he runs. What are all ...
27
votes
5answers
5k views

How to echo a bang!

I tried to create a script by echo'ing the contents into a file, instead of opening it with a editor echo -e "#!/bin/bash \n /usr/bin/command args" > .scripts/command The output: bash: ...
19
votes
3answers
969 views

Where can I find documentation about the “sudo !!” command

I just learned that Linux has a sudo !! command which literally applies sudo to the last entered command. I had never heard about it. Is that a common control? Where can I find documentation about ...
17
votes
4answers
21k views

Understanding the exclamation mark (!) in bash

I used history | less to get the lines of previous commands and from the numbers on the left hand side I found the line I wanted repeated (eg. 22) and did !22 at the command prompt and it ...
14
votes
5answers
495 views

Use same arguments with different command [duplicate]

Here's something I find myself doing often: less super/long/file/name Followed by: vim super/long/file/name Is there an easy way to pass the args of the previous command over to the next? SO I'd ...
11
votes
8answers
384 views

How to access the history on the fly in unix?

for example, if I do a mkdir thisismyfolder912 I remember there is some easier way to switch to thisismyfolder912 than having to do a cd thisismyfolder912 What is that way and how does it work? ...
7
votes
7answers
1k views

Which run dialog

I just switched from the standard Gnome window manager to Openbox (still running inside Gnome) and like it a lot. However, now I need a new run dialog, e.g. the thing popping up when hitting Alt+F2 in ...
7
votes
2answers
964 views

grep - why do brackets in grep pattern remove the grep process from ps results?

Why do brackets in a grep pattern remove the grep process from ps results? $ ps -ef | grep XXXX [...] XXXX [...] grep XXXX $ ps -ef | grep [X]XXX [...] XXXX
2
votes
2answers
5k views

Frequently used “ps” (process status) commands in linux? [closed]

EDITED: These are the the only most commonly used (and important) ps command options I've come across so far: $ ps ux, $ ps au, $ ps aux, $ ps U aahan, $ ps uU aahan So, is that all, or am I missing ...
5
votes
3answers
383 views

Execute a file in an application based on the file's extension in bash

After reading this answer about a zsh feature: If a given extension has a suffix alias, you can execute a file with that extention directly, and ZSH will launch the given program and pass ...
5
votes
1answer
138 views

Why does `!45` get replaced with `top`?

I was trying to a string search within Ubuntu 12.04 which went as follows: find . -exec grep -l "!45" {} \; Instead of searching for the string "!45", it was replaced with top. It didn't invoke the ...
3
votes
2answers
467 views

How can I apply caret-substitution to my nth-last command?

I regularly find myself having to execute a lengthy command on a file, then process the results with other commands. To process the next file, I usually rerun the same command by hitting the Up key ...
1
vote
4answers
1k views

Terminal with “repeat last” button

I'm often compiling stuff and therefore repeating the same command over and over, so I'd like to benefit from my "visual memory" and have a sort of "repeat last command" button attached to a terminal. ...
4
votes
2answers
96 views

Quicker Way to Reference a Directory?

This one is probably easy for all of you, but I have never had to deal with such a nested local set of directories. If I have a path like: /mnt/media2/Archived\ Files/_Transfer/ is there a way to ...

15 30 50 per page