Most Popular

1500 questions
124
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,350
  • 2
  • 9
  • 7
124
votes
11 answers

how to rename multiple files by replacing string in file name? this string contains a "#"

https://serverfault.com/questions/70939/how-to-replace-a-text-string-in-multiple-files-in-linux https://serverfault.com/questions/228733/how-to-rename-multiple-files-by-replacing-word-in-file-name https://serverfault.com/questions/212153/replace-stri…
Leon Francis Shelhamer
124
votes
11 answers

Is there any option with 'ls' command that I see only the directories?

Sometimes, I need to check only the directories not files. Is there any option with the command ls? Or is there any utility for doing that? EDIT: I'm using Mac OS X, and ls -d gives me . even though I have directories.
prosseek
  • 8,418
  • 16
  • 47
  • 43
124
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
  • 56,316
  • 50
  • 205
  • 279
124
votes
2 answers

When was the shellshock (CVE-2014-6271/7169) bug introduced, and what is the patch that fully fixes it?

Some context about the bug: CVE-2014-6271 Bash supports exporting not just shell variables, but also shell functions to other bash instances, via the process environment to (indirect) child processes. Current bash versions use an environment …
Deer Hunter
  • 1,866
  • 3
  • 20
  • 26
124
votes
9 answers

Solving "mv: Argument list too long"?

I have a folder with more than a million files that needs sorting, but I can't really do anything because mv outputs this message all the time -bash: /bin/mv: Argument list too long I'm using this command to move extension-less files: mv --…
Dominique
  • 5,155
  • 8
  • 26
  • 29
124
votes
3 answers

^x^y unix trick for all instances in last command?

One of my favorite Unix tricks is ^x^y, which will take the last command and replace the first instance of "x" with "y". However, I'm wondering if a similar trick works to replace all instances of "x" with "y" in the last command?
Mason
  • 1,383
  • 2
  • 9
  • 6
124
votes
4 answers

Day of week {0-7} in crontab has 8 options, but we have only 7 days in a week

Day-of-week: Allowed range 0 – 7. Sunday is either 0 or 7. I found this after Googling, my question is why should both values (0,7) correspond to Sunday?
Ruban Savvy
  • 8,409
  • 8
  • 29
  • 43
123
votes
6 answers

How to run a command without hitting Enter Key?

Accidently I mapped Enter via xkbset to Pointer_button2. Now every time I hit Enter some gibberish text appears. I thought of a workaround involving remapping it back, but that means I will have to run a command xmodmap -e "keycode 135 =…
user13107
  • 5,265
  • 10
  • 45
  • 62
123
votes
5 answers

In what order do piped commands run?

I've never really thought about how the shell actually executes piped commands. I've always been told that the "stdout of one program gets piped into the stdin of another," as a way of thinking about pipes. So naturally, I thought that in the case…
action_potato
  • 2,051
  • 3
  • 16
  • 7
123
votes
4 answers

Why does parameter expansion with spaces without quotes work inside double brackets "[[" but not inside single brackets "["?

I'm confused with using single or double brackets. Look at this code: dir="/home/mazimi/VirtualBox VMs" if [[ -d ${dir} ]]; then echo "yep" fi It works perfectly although the string contains a space. But when I change it to single…
Majid Azimi
  • 3,018
  • 6
  • 31
  • 37
123
votes
7 answers

Error when trying to connect to bluetooth speaker: `org.bluez.Error.Failed`

I'm running Debian Jessie 8.2. I have a bluetooth USB dongle connected to my machine. I run sudo bluetoothctl -a then do the following: [NEW] Controller 5C:F3:70:6B:57:60 debian [default] Agent registered [bluetooth]# scan on Discovery started [CHG]…
Username
  • 801
  • 3
  • 21
  • 38
123
votes
9 answers

How to add newlines into variables in bash script

When I do str="Hello World\n===========\n" I get the \n printed out too. How can I have newlines then?
Jiew Meng
  • 2,393
  • 7
  • 24
  • 28
123
votes
5 answers

Is there a way of reading the last element of an array with bash?

If I have an array with 5 elements, for example: [a][b][c][d][e] Using echo ${myarray[4]} I can see what it holds. But what if I didn't know the number of elements in a given array? Is there a way of reading the last element of an unknown length…
3kstc
  • 4,616
  • 15
  • 33
  • 49
123
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?
brentwpeterson
  • 3,583
  • 5
  • 18
  • 20