Most Popular

1500 questions
175
votes
1 answer

When is double-quoting necessary?

The old advice used to be to double-quote any expression involving a $VARIABLE, at least if one wanted it to be interpreted by the shell as one single item, otherwise, any spaces in the content of $VARIABLE would throw off the shell. I understand,…
kjo
  • 14,779
  • 25
  • 69
  • 109
175
votes
3 answers

Linux: Difference between /dev/console, /dev/tty and /dev/tty0

On a Linux system, what is the difference between /dev/console, /dev/tty and /dev/tty0? What are their respective uses, and how do they compare?
Axel Fontaine
  • 1,903
  • 2
  • 13
  • 10
175
votes
12 answers

GUI for GIT similar to SourceTree

Is there a similar piece of software to SourceTree, a GUI for git, for Linux? I know about Giggle, git cola, etc. I'm looking for a beautiful, easy to use GUI for git.
Glen Solsberry
  • 2,603
  • 3
  • 18
  • 15
175
votes
7 answers

Can I watch the progress of a `sync` operation?

I've copied a large file to a USB disk mounted on a Linux system with async. This returns to a command prompt relatively quickly, but when I type sync, of course, it all has to go to disk, and that takes a long time. I understand that it's going to…
mattdm
  • 39,535
  • 18
  • 99
  • 133
175
votes
1 answer

What is the difference between modify and change in stat command context?

The stat command's manual page says: %x Time of last access %y Time of last modification %z Time of last change I cannot understand the difference between modify and change. I understand the words are synonyms (English is not…
Andrew-Dufresne
  • 5,663
  • 7
  • 25
  • 19
175
votes
12 answers

Is CentOS exactly the same as RHEL?

I'm sure this question has been asked again and again elsewhere (I did not find anything specific to CentOS vs RHEL in SE), but I would still like to ask and confirm a few specific points. I am well aware that CentOS removes all RH trademarks,…
Oxwivi
  • 2,232
  • 4
  • 23
  • 31
175
votes
6 answers

What does '>/dev/null 2>&1' mean in this article of crontab basics?

I am reading an article about crontab There is something about disabling automatically sending emails. Disable Email By default cron jobs sends an email to the user account executing the cronjob. If this is not needed put the following command…
AGamePlayer
  • 7,415
  • 16
  • 46
  • 55
175
votes
5 answers

I deleted /bin/rm. How do I recover it?

Just for fun, I thought I would use this command on my Raspberry Pi running Raspbian: sudo rm -f /bin/rm I thought I could just reinstall coreutils: I was wrong! apt-get install --reinstall coreutils gives an error from dpkg, saying it couldn't…
user60684
  • 1,753
  • 2
  • 12
  • 18
174
votes
9 answers

Sorting down processes by memory usage

I am able to see the list of all the processes and the memory via ps aux and going through the VSZ and RSS Is there a way to sort down the output of this command by the descending order on RSS value?
user2817836
  • 1,843
  • 2
  • 12
  • 4
174
votes
7 answers

How to run a program in a clean environment in bash?

I want to run a program in an empty environment (i.e. with no envariables set). How to do this in bash?
Eugene Yarmash
  • 14,675
  • 14
  • 50
  • 57
174
votes
6 answers

With the Linux "cat" command, how do I show only certain lines by number

If I use cat -n text.txt to automatically number the lines, how do I then use the command to show only certain numbered lines.
Geckono1
  • 1,849
  • 2
  • 10
  • 3
174
votes
2 answers

How does systemd use /etc/init.d scripts?

I just switched to debian jessie, and most things run okay, including my graphical display manager wdm. The thing is, I just don't understand how this works. Obviously my /etc/init.d/wdm script is called, because when I put an early exit in there,…
Martin Drautzburg
  • 2,498
  • 3
  • 16
  • 18
174
votes
6 answers

Copy-Paste in xfce4-terminal adds 0~ and 1~

I use xubuntu 14.04, 64 bit. Every now and then, when I try to paste some text in xfce4-terminal, instead of the expected text to be pasted, it is surrounded by 0~ and 1~, such as: 0~mvn clean install1~ The text is supposed to be mvn clean install…
botismarius
  • 1,899
  • 2
  • 13
  • 9
174
votes
6 answers

How to make a machine accessible from the LAN using its hostname

Here are details of the machine I want to access using its hostname: $ hostname hostname $ cat /etc/hosts 127.0.0.1 localhost 127.0.1.1 hostname.company.local hostname It's a default Debian 6 (Squeeze) install, so I didn't fiddle with anything…
tshepang
  • 64,472
  • 86
  • 223
  • 290
173
votes
6 answers

How can we run a command stored in a variable?

$ ls -l /tmp/test/my\ dir/ total 0 I was wondering why the following ways to run the above command fail or succeed? $ abc='ls -l "/tmp/test/my dir"' $ $abc ls: cannot access '"/tmp/test/my': No such file or directory ls: cannot access 'dir"': No…
Tim
  • 98,580
  • 191
  • 570
  • 977