Most Popular

1500 questions
85
votes
7 answers

What directories do I need to back up?

What are the directories one should back up, in order to have a backup of all user-generated files? From a vanilla debian install, I can do enough apt to get the packages that I want. So if I don't want to backup the entire system, where all in the…
user394
  • 14,404
  • 21
  • 67
  • 93
84
votes
5 answers

How to export variables that are set, all at once?

set command displays all the local variables like below. How do I export these variables all at once? >set a=123 b="asd asd" c="hello world"
Neerav
  • 3,095
84
votes
8 answers

Best way to remove bytes from the start of a file?

Today I had to remove the first 1131 bytes from an 800MB mixed text / binary file, a filtered subversion dump I'm hacking for a new repository. What's the best way to do this? To start with I tried dd bs=1 skip=1131 if=filtered.dump…
Rup
  • 943
84
votes
4 answers

grep lines starting with "1" in Ubuntu

I try to search for lines that start with "1" using ls -1 | grep ^1* but it returns lines that do not start with 1. What I am missing here?
Tim
  • 101,790
84
votes
2 answers

Clear / erase a mistyped invisible password on a shell / terminal in Linux

One thing that annoys me using Linux's terminal is when I have to type a invisble password, like when you run ssh. Sometimes I mistype one or more letters and then I have to press backspace key a few times to make sure that I erased everything to…
84
votes
7 answers

How can I convert a PNG to a PDF in high quality so it's not blurry or fuzzy?

There are a lot of questions out there about how to convert a PDF file to a PNG image, but I'm looking to take a nice sharp PNG file and just basically wrap it or embed it in a PDF file without having it look blurry or fuzzy. I realize with…
cwd
  • 45,389
84
votes
7 answers

How to copy some, but not all files?

So, you can use the * as a wild card for all files when using cp within context of a directory. Is there a way to copy all files except x file?
84
votes
12 answers

How to run a script on screen lock/unlock?

I'd like to run a script if the Gnome session is locked and unlocked. Is there a way that I can intercept this and perform certain actions when the desktop is locked or unlocked?
Naftuli Kay
  • 39,676
84
votes
6 answers

How do I convert a ssh-keygen public key into a format that openssl PEM_read_bio_RSA_PUBKEY() function will consume?

I'm having an issue generating a public key that the openssl PEM_read_bio_RSA_PUBKEY() function can consume. I keep getting errors. Obviously I cannot simply use the ASCII string in the ssh-keygen <>.pub key file as it is in SSH file format or I…
PeteP
  • 841
84
votes
6 answers

How can I run a specific command for each find result?

How would one run a specific command for each file that was found by using the find command? For the purpose of the question lets say that I would simply like to delete each file found by find.
FailedDev
  • 943
84
votes
3 answers

ESC key causes a small delay in terminal due to its Alt+ behavior

My terminal setup is gnome-terminal + tmux + zsh with vi bindings. In applications like vim or even in the zsh's command line vi editing mode, I need to frequently hit the ESC key but there is a small delay before the effects of this key take place.…
sharat87
  • 4,259
84
votes
8 answers

How to rename multiple files using find

I want to rename multiple files (file1 ... fileN to file1_renamed ... fileN_renamed) using find command: find . -type f -name 'file*' -exec mv filename='{}' $(basename $filename)_renamed ';' But getting this error: mv: cannot stat…
84
votes
6 answers

Getting size with du of files only

How can I get the size of all files and all files in its subdirectories using the du command. I am trying the following command to get the size of all files (and files in subdirectories) find . -type f | du -a But this prints out the folder sizes as…
84
votes
2 answers

Can I get individual man pages for the bash builtin commands?

Is there anywhere you can download a manpage for every builtin commands? I know you can just use help or man bash and search to find info about it, but I want them separated, so I can just do man read and get the read manpage.
Tyilo
  • 5,981
84
votes
12 answers

Copy-paste for vim is not working when mouse (:set mouse=a) is on?

I was trying to copy paste something from vim to another application and also, from that application to vim using right click with mouse and then copy and paste (or with Ctrl+v and Ctrl+c and also tried the Command version for mac OSX, obviously.).…