Most Popular

1500 questions
80
votes
7 answers

How do you copy the public key to a ssh-server?

Here is what I have tried, and I got an error: $ cat /home/tim/.ssh/id_rsa.pub | ssh tim@just.some.other.server 'cat >> .ssh/authorized_keys' Password: cat: >>: No such file or directory cat: .ssh/authorized_keys: No such file or directory
Tim
  • 107,810
80
votes
4 answers

I accidentally typed my password into the login field, is it still secure?

I was looking down at my keyboard and typed my password in because I thought I had already typed my login name. I pressed Enter , then when it asked for the password I pressed Ctrl + c . Should I take some precautionary measure to make sure the…
hermancain
  • 1,309
80
votes
1 answer

Do I need to do something about "Delta RPMs disabled"?

While updating packages on our CentOS server I got the following message: Downloading packages: Delta RPMs disabled because /usr/bin/applydeltarpm not installed. Do I need to do something about that? Should I just ignore this?
user166758
  • 803
  • 1
  • 6
  • 6
80
votes
3 answers

Refresh aliases and functions after defining new aliases and functions?

When I define a new alias in .bash_aliases file or a new function in .bashrc file, is there some refresh command to be able immediately use the new aliases or functions without closing the terminal (in my case xfce4-terminal with a few tabs open,…
xralf
  • 14,393
  • 32
  • 119
  • 165
80
votes
4 answers

Run ./script.sh vs bash script.sh - permission denied

When I try to run ./script.sh I got Permission denied but when I run bash script.sh everything is fine. What did I do wrong?
Piotr Stapp
  • 1,023
80
votes
9 answers

Auto indent / format code for Vim?

I'm trying to use Vim more and more when I can. One of my biggest grip between Vim and an IDE like Aptana is the ability to auto indent. Is there a means of auto formatting code (HTML, CSS, PHP) so it is properly indented? If so how do you install…
80
votes
4 answers

Why doesn't the tilde (~) expand inside double quotes?

According to this answer and my own understanding, the tilde expands to the home directory: $ echo ~ /home/braiam Now, whenever I want the shell expansion to work, i. e. using variable names such $FOO , and do not break due unexpected characters,…
Braiam
  • 37,096
80
votes
7 answers

Parenthesis in expr arithmetic: 3 * (2 + 1)

expr does not seem to like parenthesis (used in mathematics to explicit operator priority): expr 3 * (2 + 1) bash: syntax error near unexpected token `(' How to express operator priority in bash?
80
votes
1 answer

How do I force remove a package in Arch with pacman?

How do I force remove a package in Arch with pacman while other packages still depend upon it. pacman -R perl-libwww checking dependencies... error: failed to prepare transaction (could not satisfy dependencies) :: perl-app-cpanminus: requires…
xenoterracide
  • 61,953
  • 80
  • 197
  • 254
79
votes
3 answers

'ps' arguments to display PID, PPID, PGID, and SID collectively

I tried ps with different kinds of switches e.g. -A , aux , ef , and so forth but I cannot seem to find the right combination of switches that will tell me the Process ID (PID), Parent Process ID (PPID), Process Group ID (PGID), and the Session ID…
JohnMerlino
  • 6,621
79
votes
4 answers

convert a hex string to binary and send with netcat

I have a binary file that I can send with netcat : $ nc -l localhost 8181 < my.dat The file contains this: $ xxd my.dat 0000000: 0006 3030 3030 4e43 ..0000NC What I really want to do is send the hex string directly. I've tried this: $ echo…
Chris Snow
  • 4,326
79
votes
1 answer

force rsync to overwrite files at destination even if they're newer

I have an rsync backup script I run, which also restores files back where they came from when I ask. But if the files at the destination are newer than those in the backup when I try to restore, it will not replace them. I really want to replace the…
jedipixel
  • 899
79
votes
5 answers

How can I remove an element from an array completely?

unset array[0] removes the element but still if I do echo ${array[0]} I get a null value moreover there are other ways of doing this but if an element of an array contains spaces like below array[0]='james young' array[1]='mary' array[2]='randy…
munish
  • 8,247
79
votes
6 answers

Tmux not sourcing my .tmux.conf

I installed tmux locally (without root priviledges). I also created my .tmux.conf file in my home directory with the following lines: unbind-key C-b set -g prefix C-o bind-key C-o send-prefix However, tmux does not seem to be sourcing this file (my…
79
votes
14 answers

Delete last N lines from bash history

When accidentally pasting a file into the shell it puts a ton of ugly nonsense entries in the bash history. Is there a clean way to remove those entries? Obviously I could close the shell and edit the .bash_history file manually but maybe there's…
ThiefMaster
  • 2,467
1 2 3
…
99
100