Most Popular

1500 questions
105
votes
3 answers

What's the purpose of the randomart image for user (not host) SSH keys?

The ssh-keygen generates the following output: The key fingerprint is: dd:e7:25:b3:e2:5b:d9:f0:25:28:9d:50:a2:c9:44:97 user@machine The key's randomart image is: +--[ RSA 2048]----+ | .o o.. | | o +Eo | | + . | | …
syntagma
  • 12,091
  • 21
  • 57
  • 74
105
votes
6 answers

How to use a shell command to only show the first column and last column in a text file?

I need some help to figure out how to use the sed command to only show the first column and last column in a text file. Here is what I have so far for column 1: cat logfile | sed 's/\|/ /'|awk '{print $1}' My feeble attempt at getting the last…
user70573
  • 1,289
  • 2
  • 9
  • 7
105
votes
3 answers

How to install dig on CentOS?

I can't find the dig command on my new CentOS installation. I've tried dnf install dig but it say that it cannot find the package. How do I install dig on CentOS?
Mikael Dúi Bolinder
  • 3,982
  • 5
  • 18
  • 23
104
votes
7 answers

How can I edit symlinks?

My basic understanding of a symlink is that it's a special file, a file that contains a string path to another file. The kernel's VFS abstracts a lot of that away but is there any reason why symlinks seem to be impossible to edit? In other words:…
Oli
  • 15,808
  • 10
  • 42
  • 51
104
votes
5 answers

Installing a .deb package on Arch - Is it possible?

The problem is simple - I have a .deb package and I want to install it on my Arch Linux. Is this possible? If yes, how?
BKC
  • 1,143
  • 2
  • 8
  • 6
104
votes
5 answers

How to check if a user can access a given file?

*nix user permissions are really simple, but things can get messy when you have to take in account all the parent directory access before reaching a given file. How can I check if the user has enough privileges? If not, then which directory is…
Metalcoder
  • 1,185
  • 2
  • 8
  • 11
104
votes
3 answers

What are character special and block special files in a unix system?

How are character special files and block special files different from regular files in a Unix-like system? Why are they called “character special” and “block special” respectively?
Geek
  • 6,548
  • 15
  • 46
  • 70
104
votes
2 answers

What is the difference between interactive shells, login shells, non-login shell and their use cases?

Possible Duplicate: Difference between Login Shell and Non-Login Shell? I have been looking at /etc/profile. bash.bashrc to see how they are run, and notice that some are executed by non-login shells, some work with interactive shells etc. What…
vfclists
  • 7,215
  • 14
  • 51
  • 79
104
votes
13 answers

How can I remove duplicates in my .bash_history, preserving order?

I really enjoying using control+r to recursively search my command history. I've found a few good options I like to use with it: # ignore duplicate commands, ignore commands starting with a space export HISTCONTROL=erasedups:ignorespace # keep the…
cwd
  • 44,479
  • 71
  • 146
  • 167
104
votes
10 answers

How to do nothing forever in an elegant way?

I have a program which produces useful information on stdout but also reads from stdin. I want to redirect its standard output to a file without providing anything on standard input. So far, so good: I can do: program > output and don't do anything…
a3nm
  • 8,978
  • 5
  • 28
  • 36
104
votes
6 answers

Can I set up system mail to use an external SMTP server?

Is it possible to set up system mail on a linux box to be sent via a different smtp server - maybe even with authentication? If so, how do I do this? If that's unclear, let give an example. If I'm at the command line and type: cat body.txt | mail -s…
cwd
  • 44,479
  • 71
  • 146
  • 167
104
votes
3 answers

How to signal the end of stdin input

In Bash, I learned that the ending signal can be changed by here document. But by default how can I signal the end of stdin input? I happened to find that with cat and chardet, their stdin inputs can be signaled as finished by Ctrl+D. But I seems…
Tim
  • 98,580
  • 191
  • 570
  • 977
104
votes
4 answers

What is the difference between 'rm' and 'unlink'?

Assuming you know the target is a symbolic link and not a file, is there any difference between using rm and unlink to remove the link?
IQAndreas
  • 10,145
  • 21
  • 59
  • 79
104
votes
12 answers

How to find out which interface am I using for connecting to the internet?

I have eth0 and wlan0 according to ifconfig and I can ping google.com. How can I find out (with a normal user, not root) what interface is active, as in, what interface did the ping (or whatever, ping is not mandatory) use? I am using Ubuntu 11.04…
LanceBaynes
  • 39,295
  • 97
  • 250
  • 349
104
votes
5 answers

Differences between sed on Mac OSX and other "standard" sed?

I am having some issues in using an answer provided on this site for this question about a sed command to replace a blank line with two other lines of content, and it was brought up if the sed command on Mac OS (10.6.7 for me) is different. I don't…
Peter Grill
  • 1,573
  • 3
  • 15
  • 19