Most Popular

1500 questions
246
votes
10 answers

Change the default sorting order in Thunderbird

Thunderbird (2.something here as 3 is still not stable and had some nasty bugs last I tried) sorts mails by date by default. This is fine, however, it sorts them so that the newest ones are at the bottom of the list, which ... is not fine. Since…
Joey
  • 41,098
244
votes
3 answers

Why are tar.xz files 15x smaller when using Python's tar library compared to macOS tar?

Context I'm compressing ~1.3 GB folders each filled with 1440 JSON files and find that there's a 15-fold difference between using the tar command and Python's built-in tarfile library on macOS or Raspbian 10 (Buster) Minimal working example This…
244
votes
6 answers

In bash, how do I escape an exclamation mark?

I want to do something like bzr commit -m "It works!". I can sort of escape the exclamation mark by doing bzr commit -m "It works\!". However, then my commit message includes the backslash. How do I escape the exclamation mark, while still ignoring…
Matthew
  • 15,036
243
votes
15 answers

How Can I Convert Github-Flavored Markdown To A PDF

I have recently started learning Markdown for use with documentation, and need to print out a few of my Markdown pages. I would like to use a command-line, Terminal, etc. utility that allows me to convert Github-flavored Markdown to PDF. It needs to…
dillmo
  • 3,091
243
votes
27 answers

Bash scripting: test for empty directory

I want to test if a directory doesn't contain any files. If so, I will skip some processing. I tried the following: if [ ./* == "./*" ]; then echo "No new file" exit 1 fi That gives the following error: line 1: [: too many arguments Is…
Anthony Kong
  • 5,318
242
votes
5 answers

Recursively count all the files in a directory

Possible Duplicate: How can I count the number of folders in a drive using Linux? I have a really deep directory tree on my Linux box. I would like to count all of the files in that path, including all of the subdirectories. For instance, given…
omghai2u
  • 2,950
242
votes
3 answers

What does the 'rc' in `.bashrc`, etc. mean?

Well, this is embarrassing. I feel like I just realised I don't know a loyal colleague's name after working with them for 10 years. "Hey, er... *cough!*, thanks for that great job you did on setting my aliases this morning..." What do the letters rc…
242
votes
10 answers

How to copy symbolic links?

I have directory that contains some symbolic links: user@host:include$ find .. -type l -ls 4737414 0 lrwxrwxrwx 1 user group 13 Dec 9 13:47 ../k0607-lsi6/camac -> ../../include 4737415 0 lrwxrwxrwx 1 user group 14 Dec 9 13:49…
Basilevs
  • 2,904
241
votes
5 answers

How to ignore certain filenames using "find"?

One of my favorite BASH commands is: find . -name '*.*' -exec grep 'SearchString' {} /dev/null \; which searches the contents of all of the files at and below the current directory for the specified SearchString. As a developer, this has come in…
Cody S
  • 2,684
241
votes
2 answers

How to reload /etc/environment without rebooting?

/etc/environment is officially the correct place for system wide environment variables. But how can I reload the assignments in this file without rebooting or relogging? Interestingly enough google does not help me here, aside from the dozens of…
fgysin
  • 3,098
241
votes
1 answer

What is port forwarding and what is it used for?

There are a lot of questions on 'port forwarding', but there doesn't seem to be one that clearly states what it is and what it's used for. So: What is port forwarding? What is it used for, and why would I need it?
James Mertz
  • 26,529
241
votes
11 answers

Show keys pressed in Linux

In Windows, one can use Keyboard Jedi to show what keys are pressed on the keyboard. Is there any way to show keys pressed in Linux?
ftravers
  • 2,802
  • 3
  • 20
  • 11
240
votes
14 answers

Cmd+Tab App Switcher is on the wrong monitor

I have an external monitor connected to my laptop, and the external monitor is set as the primary display. My problem is that sometimes after I've connected the monitor, the App Switcher still shows on the laptop screen. How can I set/reset it to…
240
votes
6 answers

Troubleshoot High CPU usage by the "System" process

I have noticed that from some time my system is freezing and it's probably caused by the high CPU usage which is caused by the system process. All applications I'm running is Skype, TeamSpeak and Chrome, so it definitely shouldn't eat that amount of…
Scott
  • 2,513
240
votes
6 answers

Stop MS Word from selecting more than I want

I would like to just select (¬Q) without word selecting both brackets. I know if I move my cursor back to the same position word will select correctly, but it's annoying to have to do that every time. Is there any setting to disable this?
Dave Chen
  • 1,947