Most Popular
1500 questions
213
votes
7 answers
How to stop the find command after first match?
Is there a way to force the find command to stop right after finding the first match?

Vombat
- 12,884
213
votes
8 answers
How to use watch command with a piped chain of commands/programs
I usually use watch Linux utility to watch the output of a command repeatedly every n seconds, like in watch df -h /some_volume/.
But I seem not to be able to use watch with a piped series of command like:
$ watch ls -ltr|tail -n 1
If I do that,…

Tulains Córdova
- 3,126
213
votes
6 answers
How can I execute `date` inside of a crontab job?
I want to create a log file for a cron script that has the current hour in the log file name. This is the command I tried to use:
0 * * * * echo hello >> ~/cron-logs/hourly/test`date "+%d"`.log
Unfortunately I get this message when that…

cwd
- 45,389
212
votes
1 answer
How do you extract a single folder from a large tar.gz archive?
I am using this command on a 5GB archive
tar -zxvf archive.tar.gz /folder/in/archive
is this the correct way to do this? It seems to be taking forever with no command line output...

Garrett Hall
- 5,281
212
votes
2 answers
Bluetooth Pairing on Dual Boot of Windows & Linux Mint/Ubuntu - Stop having to Pair Devices
When dual-booting Windows and Linux Mint/Ubuntu, you may find yourself having to re-pair your Bluetooth devices again and again. This will happen every time you switch OS.
Now, how do you prevent this?
I'm answering my own question with the…

Mario Olivio Flores
- 5,163
211
votes
9 answers
How to make `sudo` preserve $PATH?
I have a program that is installed in a custom directory under /opt. To make it easier to run it, I edited my bashrc to add said directory to my path:
export PATH=$PATH:/opt/godi/bin:/opt/godi/sbin
This works fine if I want to run the program…

hugomg
- 5,747
- 4
- 39
- 54
211
votes
5 answers
Failed to fetch jessie backports repository
I'm using a docker image as a base for my own development that adds the jessie backports repository in its Dockerfile and uses that to install a dependency. This image uses the following command to add the repository:
echo "deb…

user12345
- 2,053
211
votes
2 answers
What is the difference between Docker, LXD, and LXC
What is the difference between Docker, LXD, and LXC. Do they offer the same services or different.

Ijaz Ahmad
- 7,202
210
votes
5 answers
Understanding of diff output
I have file1.txt
this is the original text
line2
line3
line4
happy hacking !
and file2.txt
this is the original text
line2
line4
happy hacking !
GNU is not UNIX
if I do: diff file1.txt file2.txt I get:
3d2
< line3
5a5
>…

Jim
- 10,120
210
votes
8 answers
Automated ssh-keygen without passphrase, how?
I would like to make an automated script that calls ssh-keygen and creates some pub/private keypairs that I will use later on. In principle everything works fine with....
ssh-keygen -b 2048 -t rsa -f /tmp/sshkey -q
...except that it asks me for the…

humanityANDpeace
- 14,392
210
votes
9 answers
Is Linux a Unix?
So, there are lots of different versions of Unix out there: HP-UX, AIX, BSD, etc. Linux is considered a Unix clone rather than an implementation of Unix. Are all the "real" Unices actual descendants of the original? If not, what separates Linux from…

Shawn J. Goff
- 46,081
209
votes
10 answers
tmux vs. GNU Screen
Browsing through questions I found about tmux (I normally used GNU Screen). My question is what are pros and cons of each of them. Especially I couldn't find much about tmux.

Maja Piechotka
- 16,676
209
votes
11 answers
Rsync filter: copying one pattern only
I am trying to create a directory that will house all and only my PDFs compiled from LaTeX. I like keeping each project in a separate folder, all housed in a big folder called LaTeX. So I tried running:
rsync -avn *.pdf ~/LaTeX/ ~/Output/
which…

Seamus
- 3,613
- 7
- 25
- 26
209
votes
2 answers
How to put current line at top/center/bottom of screen in vim?
Any quicker navigation trick to place the line at which the cursor is at the moment to the
top of the screen?
center of the screen?
bottom of the screen?

mtk
- 27,530
- 35
- 94
- 130
207
votes
9 answers
Copy text from one tmux pane to another (using vim)
I have two files opened in vim, each in one tmux pane. I would like to copy let's say 10 lines from one file to another.
How can I accomplish this not using the mouse's Copy -> Paste ?

Patryk
- 14,096