Most Popular

1500 questions
126
votes
2 answers

How do I display log messages from previous boots under CentOS 7?

Executing journalctl under a CentOS 7 system just prints messages generated after the last boot. The command # journalctl --boot=-1 prints Failed to look up boot -1: Cannot assign requested address and exits with status 1. Comparing it to a…
maxschlepzig
  • 57,532
126
votes
3 answers

What does the (!) mean after uptime on htop

I was analyzing some web heads looking at htop and noticed the following Uptime: 301 days(!), 23:47:39 What does the (!) mean?
125
votes
6 answers

How to download an archive and extract it without saving the archive to disk?

I'd like to download, and extract an archive under a given directory. Here is how I've been doing it so far: wget http://downloads.mysql.com/source/dbt2-0.37.50.3.tar.gz tar zxf dbt2-0.37.50.3.tar.gz mv dbt2-0.37.50.3 dbt2 I'd like instead to…
BenMorel
  • 4,587
125
votes
4 answers

Reserved space for root on a filesystem - why?

I understand that by default, newly created filesystems will be created with 5% of the space allocated for root. I also know you can change the defined space with: tune2fs -m 1 /dev/sdXY What I'm curious about though, is what the actual purpose for…
suitedupgeek
  • 1,353
125
votes
11 answers

Uploading directories with sftp?

I'm having some trouble uploading directories(which contain other directories a few levels deep) by sftp. I realize I could work around this by gzipping, but I don't see why that's necessary. Anyway, I try sftp> put bin/ Uploading bin/ to…
Earlz
  • 2,264
  • 2
  • 17
  • 12
125
votes
8 answers

How to get the first word of a string?

When I echo * I get the following output: file1 file2 file3 ... What I want is to pick out the first word. How can I proceed?
vdegenne
  • 1,746
125
votes
3 answers

SSH login with clear text password as a parameter?

I need to login to a user that I've created on a remote host running Ubuntu. I can't use an ssh key because the ssh login will happen from a bash script ran within a server that I won't have access to (think continuous integration server like…
mmla
  • 1,377
125
votes
5 answers

How to define and load your own shell function in zsh

I am having a hard time defining and running my own shell functions in zsh. I followed the instructions on the official documentation and tried with easy example first, but I failed to get it work. I have a folder: ~/.my_zsh_functions In this…
125
votes
4 answers

How to troubleshoot DNS with systemd-resolved?

How would you go about finding the DNS servers used by systemd-resolved, for troubleshooting purposes? Generally I can use dig and test the DNS servers shown in /etc/resolv.conf. (Or windows - ipconfig /all + nslookup). But that approach doesn't…
sourcejedi
  • 50,249
125
votes
9 answers

On what systems is //foo/bar different from /foo/bar?

Throughout the POSIX specification, there's provision (1, 2, 3...) to allow implementations to treat a path starting with two / specially. A POSIX application (an application written to the POSIX specification to be portable to all POSIX compliant…
125
votes
6 answers

What's the best way to join files again after splitting them?

If I have a large file and need to split it into 100 megabyte chunks I will do split -b 100m myImage.iso That usually give me something like xaa xab xac xad And to get them back together I have been using cat x* > myImage.iso Seems like there…
cwd
  • 45,389
125
votes
4 answers

How can I make a script in /etc/init.d start at boot?

I think I read something a while back about this, but I can't remember how it's done. Essentially, I have a service in /etc/init.d which I'd like to start automatically at boot time. I remember it has something to do with symlinking the script…
Naftuli Kay
  • 39,676
125
votes
8 answers

Why is video tearing such a problem in Linux?

I've used many variants of Linux(mostly Debian derivatives) for over a decade now. One problem that I haven't seen solved satisfactorily is the issue of horizontal tearing, or Vsync not being properly implemented. I say this because I use used 5…
Ten Bitcomb
  • 1,360
125
votes
10 answers

How to check which GPU is active in Linux?

I have 2 GPU's in my netbook. How do I know which one I'm actually using at any given moment?
LanceBaynes
  • 40,135
  • 97
  • 255
  • 351
125
votes
12 answers

ssh_exchange_identification: read: Connection reset by peer

I am on OS X trying to ssh into a ubuntu 12.04 server. I was able to SSH in -- until abruptly stuff stopped working. I've read online to use the -v to debug this. Output is shown below. If I ssh into a different box and then ssh from that box to the…
bernie2436
  • 6,655