Most Popular

1500 questions
206
votes
17 answers

mount: wrong fs type, bad option, bad superblock

I added a new hard drive (/dev/sdb) to Ubuntu Server 16, ran parted /dev/sdb mklabel gpt and sudo parted /dev/sdb mkpart primary ext4 0G 1074GB. All went fine. Then I tried to mount the drive mkdir /mnt/storage2 mount /dev/sdb1 /mnt/storage2 It…
Eli Korvigo
  • 2,183
  • 2
  • 11
  • 7
206
votes
6 answers

Where do I put my systemd unit file?

I read that there are two folders for unit files (not in user mode). /usr/lib/systemd/system/: units provided by installed packages /etc/systemd/system/: units installed by the system administrator Conflicting with this understanding is the answer…
Jonathan Komar
  • 5,974
  • 7
  • 33
  • 52
206
votes
2 answers

How to put current line at top/center/bottom of screen in vim?

Any quicker navigation trick to place the line at which the cursor is at the moment to the top of the screen? center of the screen? bottom of the screen?
mtk
  • 26,802
  • 35
  • 91
  • 130
205
votes
11 answers

List files sorted numerically

I have a bunch of files from log1 to log164. I'm trying to LIST the directory (sorted) in a UNIX terminal but the sort functions are only providing the format like this: home:logs Home$ ls -1 |…
Rabiani
205
votes
5 answers

How do I determine the number of RAM slots in use?

I forgot how many RAM (DIMM) modules are installed on my laptop. I do not want to unscrew it but want to look it up on the console using bash. How do I gather this information?
k0pernikus
  • 14,853
  • 21
  • 58
  • 79
205
votes
11 answers

Rsync filter: copying one pattern only

I am trying to create a directory that will house all and only my PDFs compiled from LaTeX. I like keeping each project in a separate folder, all housed in a big folder called LaTeX. So I tried running: rsync -avn *.pdf ~/LaTeX/ ~/Output/ which…
Seamus
  • 3,553
  • 7
  • 25
  • 25
205
votes
2 answers

How do I unset a variable at the command line?

I have tried the following command to set Proxy on yaourt: export ALL_PROXY=http://proxy.example.com:8080 The question is how to unset the proxy on yaourt? In general, how can I unset the value of a variable in the current shell?
Hamed Kamrava
  • 6,678
  • 12
  • 35
  • 47
204
votes
5 answers

How can I wrap text at a certain column size?

I know that I can use something like cat test.txt | pr -w 80 to wrap lines to 80 characters wide, but that puts a lot of space on the top and bottom of the printed lines and it does not work right on some systems What's the best way to force a text…
cwd
  • 44,479
  • 71
  • 146
  • 167
203
votes
6 answers

Zip the contents of a folder without including the folder itself

I have a directory called folder that looks like this: folder -> root_folder -> some files I want to zip this directory into zipped_dir, I tried: zip -r zipped_dir.zip folder/* But this generates a ZIP that looks like…
Juicy
  • 3,685
  • 11
  • 31
  • 44
202
votes
11 answers

How to export variables from a file?

I have a tmp.txt file containing variables to be exported, for example: a=123 b="hello world" c="one more variable" How can I export all these variables using the export command, so that they can later be used by child processes?
Neerav
  • 2,915
  • 3
  • 15
  • 7
202
votes
9 answers

Copy text from one tmux pane to another (using vim)

I have two files opened in vim, each in one tmux pane. I would like to copy let's say 10 lines from one file to another. How can I accomplish this not using the mouse's Copy -> Paste ?
Patryk
  • 13,556
  • 22
  • 53
  • 61
202
votes
2 answers

In CentOS, what is the difference between yum update and yum upgrade?

What is the difference between yum update and yum upgrade, and when should I use one over the other?
Lester Peabody
  • 2,359
  • 5
  • 17
  • 13
202
votes
4 answers

What is the point of Ctrl-S?

Ctrl+S stops all output to the terminal which can be restarted with Ctrl+Q. But, why does Ctrl+S exist in the first place? What problem was trying to be solved by putting that control sequence in place?
Jeff King
  • 2,155
  • 2
  • 14
  • 8
202
votes
8 answers

What color codes can I use in my Bash PS1 prompt?

I used several colors in my bash PS1 prompt such as: \033]01;31\] # pink \033]00m\] # white \033]01;36\] # bold green \033]02;36\] # green \033]01;34\] # blue \033]01;33\] # bold yellow Where can I find a list of the color codes I can use? I…
Michael Durrant
  • 41,213
  • 69
  • 165
  • 232
202
votes
5 answers

do changes in /etc/security/limits.conf require a reboot?

Do changes in /etc/security/limits.conf require a reboot before taking effect? For example, if I have a script that sets the following limits in /etc/security/limits.conf, does this require a system reboot before those limits will take effect? *…
Alexej Magura
  • 4,356
  • 7
  • 26
  • 39