Most Popular

1500 questions
265
votes
20 answers

How can I add a signature .png to a PDF in Linux?

I have a scanned copy of my written signature and I need to apply it to some documents in the signature block. I used to do this on Windows all the time but I now have only Linux. Is this possible? How can I add a signature image to a PDF file in…
Freedom_Ben
  • 4,494
265
votes
3 answers

Difference between cp -r and cp -a

I'm looking for the difference between cp -r and cp -a. What does "recursive" mean in terms of copying files from a folder?
Randy
  • 2,759
265
votes
11 answers

Allow setuid on shell scripts

The setuid permission bit tells Linux to run a program with the effective user id of the owner instead of the executor: > cat setuid-test.c #include #include int main(int argc, char** argv) { printf("%d", geteuid()); …
Michael Mrozek
  • 93,103
  • 40
  • 240
  • 233
265
votes
21 answers

How do I get the MD5 sum of a directory's contents as one sum?

The md5sum program does not provide checksums for directories. I want to get a single MD5 checksum for the entire contents of a directory, including files in sub-directories. That is, one combined checksum made out of all the files. Is there a way…
user17429
264
votes
6 answers

VISUAL vs. EDITOR – what’s the difference?

I generally set both VISUAL and EDITOR environment variables to the same thing, but what's the difference? Why would I set them differently? When developing apps, why should I choose to look at VISUAL before EDITOR or vice versa?
xenoterracide
  • 59,188
  • 74
  • 187
  • 252
264
votes
3 answers

Why does `htop` show more process than `ps`

In ps xf 26395 pts/78 Ss 0:00 \_ bash 27016 pts/78 Sl+ 0:04 | \_ unicorn_rails master -c config/unicorn.rb 27042 pts/78 Sl+ 0:00 | \_ unicorn_rails worker[0] -c config/unicorn.rb …
Cheng
  • 6,641
263
votes
16 answers

How to fill 90% of the free memory?

I want to do some low-resources testing and for that I need to have 90% of the free memory full. How can I do this on a *nix system?
263
votes
4 answers

How to tell gzip to keep original file?

I would like to compress a text file using gzip command line tool while keeping the original file. By default running the following command gzip file.txt results in modifying this file and renaming it file.txt.gz. instead of this behavior I would…
Manuel Selva
  • 3,494
262
votes
12 answers

linux: How can I view all UUIDs for all available disks on my system?

My /etc/fstab contains this: # / was on /dev/sda1 during installation UUID=77d8da74-a690-481a-86d5-9beab5a8e842 / ext4 errors=remount-ro 0 1 There are several other disks on this system, and not all disks are being mounted to…
Stefan Lasiewski
  • 19,754
  • 24
  • 70
  • 85
261
votes
6 answers

How can I delete a word backward at the command line (bash and zsh)?

How can I delete a word backward at the command line? I'm truly used to some editors deleting the last 'word' using Ctrl+Backspace, and I'd like that functionality at the command line too. I am using Bash at the moment and although I could jump…
lucidquiet
  • 2,859
261
votes
7 answers

List all connected SSH sessions?

I just SSH'd into root, and then SSH'd again into root on the same machine. So I have two windows open both SSH'd into root on my remote machine. From the shell, how can I see a list of these two sessions?
themirror
  • 6,988
261
votes
3 answers

Linux "top" command: What are us, sy, ni, id, wa, hi, si and st (for CPU usage)?

When I issue top in Linux, I get a result similar to this: One of the lines has CPU usage information represented like this: Cpu(s): 87.3%us, 1.2%sy, 0.0%ni, 27.6%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st While I know the definitions of each of…
its_me
  • 13,959
260
votes
10 answers

What causes this green background in ls output?

There are two directories shown by 'ls'. Normally directories anywhere are blue on black background. But the first one is blue on green and impossible to read. Why is this? How to make it blue on black, or at least something light on something…
DarenW
  • 3,443
260
votes
12 answers

How do I make my pc speaker beep

Using bash, how can I make the pc speaker beep? Something like echo 'beepsound' > /dev/pcspkr would be nice.
Stefan
  • 25,300
260
votes
9 answers

scp without replacing existing files in the destination

How do I copy an entire directory into a directory of the same name without replacing the content in the destination directory? (instead, I would like to add to the contents of the destination folder)
biznez