Hot answers tagged command
Question is already answered on stackoverflow: http://stackoverflow.com/questions/274560/how-do-you-test-a-public-private-keypair (Can I mark a question as duplicate on another stackexchange network?) I would prefer the ssh-keygen -y -e -f <private key> way instead of the accepted answer on SO. ssh-keygen -y -e -f <private key> takes a private ...
Just create this script /usr/bin/nginx_modsite and make it executable. #!/bin/bash ## # File: # nginx_modsite # Description: # Provides a basic script to automate enabling and disabling websites found # in the default configuration directories: # /etc/nginx/sites-available and /etc/nginx/sites-enabled # For easy access to this script, ...
SSH connects stdin, stdout and stderr of the remote shell to your local terminal, so you can interact with the command that's running on the remote side. As a side effect, it will keep running until these connections have been closed, which happens only when the remote command and all its children (!) have terminated (because the children, which is what ...
It's an alternative form of the 'test' command. Mostly used in scripts. i.e. if [ $VAR ] then echo $VAR exists! fi
If you have installed the nginx package from the Ubuntu repositories, you will have two directories. /etc/nginx/sites-enabled and /etc/nginx/sites-available. In the main nginx configuration, /etc/nginx/nginx.conf, you have the following line: include /etc/nginx/sites-enabled/*.conf; So basically to list all available virtualhosts, you can run the ...
This is actually dependent on your shell. Quotes (either kind) are primarily meant to deal with whitespace. For instance, the following: grep hello world file1 will look for the word "hello" in files called "world" and "file1", while grep "hello world" file1 will look for "hello world" in file1. The choice between single or double quotes is only ...
If you're not too fussy about the appearance of the separator: tail -n +1 *
Not natively but check out: http://mridgers.github.io/clink/ , makes cmd.exe much more productive. Quoting features from the project page: Powerful Bash-like line editing from GNU's Readline library. Superior path completion (TAB). Paste from clipboard (Ctrl-V). Support for the completion of executables/commands, and environment variables. Undo/Redo (Ctrl-_ ...
Are you referring to nginx_ensite and nginx_dissite?
Not sure there is an answer to this when using a mouse. If you wanted a command-line way to do it, you can just echo the command and pipe that output to clip: echo stuff you wanted copied to the clipboard | clip FYI, clip is available on Windows 2003. I believe it is a built-in.
Use the CHARACTER SET option when creating your database, like so: CREATE DATABASE dbname CHARACTER SET utf8 COLLATE utf8_bin; also, read the docs...
Correct, [/usr]/[s]bin is for the distro creator's use. Local user scripts belong under /usr/local, specifically /usr/local/bin in this case. Filesystem Hierarchy Standard
You can prepend the current directory: cd ./-
Just do echo "my file content as a string" | my_command
Look at: clusterssh
$^ is a variable that expands to the last executed Powershell command. You can run a command as another user using runas, so the following works: runas /user:domain\administrator $^ To shorten that up a bit, you can do some magic with aliases. Take a look at this Technet article for more info. EDIT: One caveat - $^ only executes the first command in a ...
cd /to/your/directory; for each in *; do cat $each; echo "XXXXXXXXXXX"; done
Rephrasing the question, you want to know when someone attempts to set the system time. This is exactly what the audit subsystem is for...it allows you to audit the execution of specific system calls. In this case, you want to know whenever someone calls any of the various system calls that can change the system time. By using the audit subsystem, you ...
The server has been hacked. Google "opyum team." Take server offline ASAP and restore from known-good backups.
You can import (execute) an SQL file using the following command: $ mysql -u user -p mydb < dump.sql If you exported your data using some tool other than mysqldump, you may have troubles restoring your dump file. I ran into such a problem when I exported the database using phpmyadmin and imported it using the command line. To export your database, you ...
If database name contains nonalphanumeric chars use "`" to quote: CREATE DATABASE `my-db` CHARACTER SET utf8 COLLATE utf8_general_ci; When using in shell script quote the quotes with "\" mysql -p -e "CREATE DATABASE \`my-db\` CHARACTER SET utf8 COLLATE utf8_general_ci;"
It's what you call when you are using something like if [ -e foo ]; then ... in a shell script (but most shells have it as a buildin this days). man test should give you the docs.
No, Windows command prompt history can't be saved when a session ends.
James is correct, but to add some more data, I think that the best way to think about it is as arguments to the command: do you intend "hello" and "world" to be two arguments or "hello world" to be one argument. Also, doublequotes allow interpretation of more than just variables. Exactly what depends on your shell, but check into history expansion, brace ...
'screen' - allows for detachable, re-attachable command line sessions. Made extra shiny with screen-profiles (default in Ubuntu 9.04), and byobu in 10.04
What problems are you having with PSExec and W2k3 exactly? We use the two together extensively, in a 500+ W2k3 server environment... In fact, the whole PSTools suite rocks my world. EDIT: This is a followup to your edit of the original ticket. The problem you're encountering is that "copy" is a function of CMD.exe. It doesn't exist as its own ...
If I understand what you want to do properly, you can do it with bash's command substitution feature: foo <(somecommand | pv) This does something similar to what the mkfifo-based answers suggest, except that bash handles the details for you (and it winds up passing something like /dev/fd/63 to the command, rather than a regular named pipe). You might ...
You could always try doing 310 minutes instead.
There's no point in re-sourceing a new .bashrc within Puppet, because it'll run in a subshell and the changes won't propagate into your current shell (which is, I assume, what you're trying to do). You can't do what (I think) you want to do.
Only top voted, non community-wiki answers of a minimum length are eligible