Most Popular

1500 questions
142
votes
4 answers

Bash if on single line

I would like to know how can I write if conditions inside a bash script on a single line. For example, how can I write this on a single line, and then put another one just like it on the next? if [ -f "/usr/bin/wine" ]; then export…
141
votes
4 answers

Which linux filesystem works best with SSD

From wiki: The vital TRIM function is supported by the Linux OS starting with 2.6.33 kernel (available early 2010). However, support amongst various filesystems is still inconsistent or not present. Proper partition alignment is also not…
hbt
  • 1,641
141
votes
4 answers

How do I open a blank new file in a split in Vim?

Must be something super obvious, but I can't figure out, and Google is not helping out either.
hakanensari
  • 2,167
140
votes
5 answers

How can I determine what process has a file open in Linux?

I'd like to determine what process has ownership of a lock-file. The lock-files are simply a file with a specific name that has been created. So, how can I determine what process has a particular file open in Linux? Preferably a one-liner type or a…
Danny
  • 1,604
140
votes
2 answers

What is the difference between 4K, UHD and QHD? Do we agree on one official resolution?

Nowadays it seems that Full HD isn’t enough anymore and the terms “4K,” “QHD” and “UHD” are thrown around interchangeably. At the same time, there is not just one “4K” resolution in the catalogs. I have seen resolutions such as 2560 x 1600, 3440 x…
KarmaEDV
  • 2,371
140
votes
4 answers

Why do damaged hard drives freeze the entire system?

Why does a hard drive which is known to have bad blocks (verified in HDTune and HDDScan), freezes down my entire system? It is not the OS drive; it is attached to another SATA port, and I'm trying to copy files from it to another healthy drive. I…
JustAMartin
  • 1,571
140
votes
8 answers

How can I unzip a .tar.gz in one step (using 7-Zip)?

I am using 7-Zip on Windows XP and whenever I download a .tar.gz file it takes me two steps to completely extract the file(s). I right-click on the example.tar.gz file and choose 7-Zip --> Extract Here from the context menu. I then take the…
quickcel
  • 4,819
140
votes
1 answer

Why is the total memory usage reported by Windows Task Manager much higher than the sum of all processes' memory usage?

Task Manager shows my total memory usage at 90% of my 6 GB total, but no single process is using more than 250 MB RAM, and the sum of RAM use of all running processes is less than 2 GB. I've tried: Looking at the numbers in the "Memory" column on…
Josh
  • 3,019
140
votes
11 answers

How to move all files from current directory to upper directory?

How to move all files from current directory to upper directory in linux? I tried something like mv *.*, but it doesn't work.
asksuperuser
140
votes
3 answers

vim freezes inside tmux

I’m using split panes in tmux – one being vim, the other being a shell.  Sometimes, around once a day, vim freezes.  I can move between panes, perform any tmux commands, just vim doesn’t react to anything.  This happens only with tmux.  My only…
140
votes
7 answers

How do I create a 1GB random file in Linux?

I am using the bash shell and would like to pipe the out of the command openssl rand -base64 1000 to the command dd such as dd if={output of openssl} of="sample.txt bs=1G count=1. I think I can use variables but I am however unsure how best to do…
140
votes
11 answers

How can I add an item to the 'new' context menu?

When I right click anywhere I get an option to add a new file with a specified extension. I would like to add some custom files into this menu, so I can right click and create a new PHP file for instance. How can I do this?
James
140
votes
16 answers

How to synchronize the home folder between multiple computers?

I have three computers at home, and would like to have the /home/ folder tree synchronized between the three. Any files/folders (except those hidden) that are modified/added/removed in one of the three computers is updated in the other two. Is rsync…
lamcro
  • 812
140
votes
4 answers

How does Windows know whether it has internet access or if a Wi-Fi connection requires in-browser authentication?

In Windows 7, the notification area networking icon will show an error indicator if there is no internet access , and the error icon goes away once there is a successful connection to the internet . Sometimes, if the WiFi connection requires an…
nhinkle
  • 37,390
140
votes
5 answers

Setting and using variable within same command line in Windows cmd.exe

In Bash, I can do EDITOR=vim command and command will be run with EDITOR set to vim, but this won't affect the value of EDITOR in the shell itself. Is it possible to do this in cmd.exe?