The tag has no usage guidance.

learn more… | top users | synonyms

2
votes
1answer
25 views

Trouble using powershell output as a variable in batch file

I can manually run this command from a Windows Command Prompt: powershell (new-timespan -start 01/01/2000 -end (get-date)).days % 14 And it returns a number from 0 to 13. I want to use this result ...
6
votes
4answers
9k views

PowerShell script, showing commands run

I am playing around with PowerShell scripts and they're working great. However, I am wondering if there is any way to also show all the commands that were run, just as if you were manually typing ...
0
votes
1answer
9 views

One vagrant command to create and provision machine whether machine is created or not?

When my VM is not created, I can run: vagrant up or: vagrant up --provision but not vagrant provision, because of the warning: VM not created. Moving on... When my VM is created, I can run:...
0
votes
1answer
65 views

Write to file (Nagios3)

I try to make script/command in nagios3 at write in new file some data but nagios will not do that. I try that simple bash command: printf "something" > /path-to-file/new-file But nagios don't ...
0
votes
0answers
38 views

Config Server LFD sends reports on /usr/bin/php but does not list a process

So I am running a cPanel VPS (Virtuozzo based), I have nginx as a proxy to apache, and am running php 5.6 with FCGI as the handler. I am getting loads of email alerts each day such as the 2 below: ...
-1
votes
1answer
21 views

robocopy cannot find path [closed]

i have batch script like bellow: SET SOURCE=F:\Diff\For_VOYAGE\models.pck.files\models\players SET DESTINATION=F:\Diff\For_VOYAGE\models.pck.files\NEW\models\players SET LOG=LOG.txt robocopy %SOURCE%\...
41
votes
4answers
70k views

Nginx enable site command

We all know how to enable a website using apache on linux. I'm pretty sure that we all agree on using the a2ensite command. Unfortunately there is no default equivalent command comes with Nginx, but ...
19
votes
3answers
3k views

What is /usr/bin/[?

I was just poking around in /usr/bin and I found an ELF binary file called [. /usr/bin/[. I have never heard of this file and my first thought was that it was a clever way of hiding a program, ...
20
votes
3answers
37k views

How to check if a RSA public / private key pair matched

I have two files, id_rsa and id_rsa.pub, what command can be used to validate if they are the valid pair.
-1
votes
2answers
34 views

Debian statistics - cpu, memory, hdd

I'm wondering how can I get my dedicated server avarage statistics for last month/ week. I used sysstat and sar to report my logs, but they are seems to be too much I'm interested about averege final ...
0
votes
0answers
20 views

Run a script if another process was spotted

I have CentOS 7 and looking for a sollution about a small issue. I want to have a sudo script to be run but only if the system executed a specific command remotely. For example: I've put my command ...
0
votes
0answers
40 views

Delete files older than x days permissions

I have a folder that I have to run the following script find folder/ -ctime +7 -exec rm {} \; To delete files in the folder older then x days. But I can't let the root user do that, there will be a ...
0
votes
1answer
47 views

SUDO command only works as root (Solaris 10)

After installing sudo in the system i am unable tu run sudo as a non-root user, when i try to execute any command i get: /usr/local/bin/sudo: cannot execute if i edit /etc/passwd to use a different ...
1
vote
1answer
83 views

Windows PowerShell - How to view commands history date/time [closed]

I want to list entered commands in Windows PowerShell with their respective timestamps. How can I do it with Get-History command? Also if that isn't doable then please show me a way to check which ...
0
votes
0answers
20 views

node forever node cleaning up properly - lingering processes

I have the following sshTunnel.js file (it's a very simple ssh tunnel listening locally on port 8080): #!/usr/local/bin/node var cmd = 'ssh -C2qTnN -D 8080 eamorr@myserver.com'; require('...
3
votes
1answer
130 views

How to find the ip address of the pc that sent a shutdown command?

I'm a system administrator in a school. We have a classroom with 20 PC's in a domain, and all PC's use the same user to log in. Sometimes students use the shutdown command to shut down the PC's of ...
3
votes
2answers
309 views

SSH authorized_keys command option: multiple commands?

The authorized_keys has a command="..." option that restricts a key to a single command. Is there a way to restrict a key to multiple commands? E.g. by having a regex there, or by editing some other ...
4
votes
3answers
9k views

Can I run a shell built-in command with Puppet?

I want ~/.bashrc will be source whenever changing its content. I created a bashrc class with something like this: file { "/root/.bashrc": ensure => present, owner => root, group ...
0
votes
1answer
47 views

What does '— --daemon' mean in start-stop-daemon?

On this man page for start-stop-daemon, there is an example: start-stop-daemon --start --oknodo --user food --name food --pidfile \ /var/run/food.pid --startas /usr/sbin/food --chuid food -- --...
0
votes
0answers
58 views

Packet Tracer 6.1.1 ISAKMP command not available

I am just going around in circles trying to configure a site to site VPN using the CLI on the ASA 5505 in Packet Tracer 6.1.1 When I am configuring isakmp the command just do not seem to be abailable ...
-1
votes
1answer
4k views

where is systemctl command in redhat 6.6 64 bit OS?

I was trying to run status of network by following commands. sudo systemctl status network However the system says systemctl command not found.
2
votes
1answer
17k views
0
votes
0answers
21 views

Replace exact rows from some .js files with some other rows from another file

I have a situation where i need to change some encoded text (or better, an entire row) on some .js files on my server. What i think that will be better is a way to remove entire row (ex: row 2 and row ...
3
votes
5answers
2k views

fdisk - partition in single line

Can you create a partition in a usb disk using fdisk command in a single line. fdisk command is interactive in nature, But I want to automate partition creation in a single line using fdisk command.
0
votes
2answers
171 views

How to take backup of a table on a different schema in PostgreSQL

Please let us know in PostgreSQL how we can take backup of a table on a different schema. We have db named "geopostgrest" and under Schema named "1" (Not inside Public Schema) we need to take backup ...
11
votes
5answers
4k views

Pass a pipe to a command that expects a filename

Say I have a command foo which takes a filename argument: foo myfile.txt. Annoyingly, foo doesn't read from standard input. Instead of an actual file, I'd like to pass it the result of another command ...
1
vote
1answer
98 views

Command substitution into bash script $1 value

I have this simple script which changes permissions on my apache2 websites /var/www/html# cat permissions_setup.sh chown -R root $1 chgrp -R www-data $1 chmod -R 750 $1 chmod g+s $1 I have two .sh ...
12
votes
2answers
14k views

Command to create MySQL database with Character set UTF-8

I use create database dbname; to create database. but I want it to created with Character set UTF-8 Anyone know what is the command to use?
0
votes
1answer
16 views

run remote command to save debian package list

I'd like to backup the package list(dpkg) of some remote computers to a backup server: all of them running Debian. I already configured the rsa key to login remotely as root on the other computers ...
0
votes
2answers
92 views

how to identify a command prompt window?

Enviroment: windows 7 Currently i have machine on which we launch 2 batch files on system start up. These batch files internally run multiple programs by running on separate command prompt windows. ...
-1
votes
1answer
53 views

Search for file names containing space

I have a batch file that helps me in install multiple pieces of software from a shared folder. It's working well with software whose names don't contain spaces, but I need it to work with software ...
1
vote
2answers
42 views

How to cp only into the latest directory name?

mkdir test_dir test_dir1 test_dir2 test_dir3 touch file1 file2 file3 cp -v file* test_dir*/ This copies only to test_dir3 and not in test_dir, test_dir1, test_dir2. Why? For that matter it copies ...
0
votes
3answers
236 views

How to find which folder is eating space fast? [duplicate]

I am running Linux server, we using this server as a samba share drive. From yesterday suddenly, one of the share drive size getting increasing (~ 100 MB every ten min). There are too many folders and ...
2
votes
3answers
144 views

Output of a command to the first line of a file

I am trying to insert output of a command into the first line of a file. For example, I have a file named "list.txt" and want to insert a text containing all the file names in that folder. A way to ...
1
vote
1answer
1k views

Issue command on multiple systems at once using MCollective

Aim The aim is to execute a command on multiple systems at once using MCollective, e.g., touch /tmp/helloworld using MCollective-client creates touch /tmp/helloworld on all MCollective-servers: ...
11
votes
3answers
6k views

Linux: cat with separators among files

In Linux if you type cat *, you will get something like this: line1 from file1 line2 from file1 line1 from file2 line1 from file3 line2 from file3 line3 from file3 What I would like is to display ...
1
vote
1answer
520 views

mysql won't run from command line

When trying to run the /etc/bin/mysql command from the command line, I'm returned to the prompt without any action. Restarting mysql via /etc/init.d/mysql restart shows the following error during the ...
2
votes
2answers
2k views

Meaning of killall -0

I see from many place the follow command is used to check if a process exists, e.g. killall -0 nginx But from the documentation I can't see anything related to this argument, can anyone explain?
-2
votes
1answer
68 views

How to get a process ID automaticly with command prompt [closed]

I´d want to know how to get a PID of a process with a single command in command prompt. I tried it with findstr, but I´m (apparently) not so smart to figure it out. You cannot use tasklist, because ...
3
votes
1answer
741 views

Meaning of requeues of tc command

I ran this tc bellow and it outputs requeues with high number, do you know what this requeues means? By the way, it keeps increasing over the time. I look at man tc but I couldn't find anything. $ ...
1
vote
1answer
594 views

Command apt-get -t wheezy-backports install linux-image-amd64

I have a server with Debian wheezy and kernel vmlinuz-3.2.0-4-amd64, hosted at OVH. I would like to upgrade the kernel. Normally at ovh, you can find some kernel already configured. but the files I ...
5
votes
1answer
2k views

Installing a php extension (xdiff) from pecl on Linux

I was getting this error on my php script: Fatal error: Call to undefined function xdiff_file_diff() I realised that I didn't had the xdiff extension installed. When I tried to install it using the ...
4
votes
6answers
3k views

Same command on multiple servers

I'm just wondering if there is any fellow sysadmin with the need to execute one command on multiple servers. If so, what technique are you using? I have grown tired to ssh-ing to 3-5 servers and ...
33
votes
6answers
77k views

Is there a global, persistent CMD history?

Sometimes I forget how the exact syntax of a CMD command looks and then I would like to search my own CMD history. Clearly, within the same session, you can browse it with the up and down arrow keys ...
1
vote
1answer
87 views

dsget error probably because of users with “-” in their name

I'm trying to run a dsquery/dsget that will result in users that weren't active for a month and that are not disabled: dsquery user -inactive 4 -limit 0 | dsget user -samid -disabled >>desktop\users....
1
vote
2answers
431 views

Can I find the list of ports being listened by a process ordered by the time of opening?

I know I can see the list of open ports using the lsof command. I am trying to view the results ordered by timestamp of listening. The process opens multiple (~6) ports and I suspect the order of ...
2
votes
2answers
4k views

why does sudo su; su tomcat doesn't switch to tomcat user?

In Redhat linux. from my user if I issue command sudo su -> changes to root su tomcat --> changes to tomcat user Why does tailing the commands in single line doesn't work? sudo su; su tomcat --> stil ...
-1
votes
2answers
410 views

can't find the executable for the command linux 'source' [closed]

i am using ubuntu server 12.04 lts. I am looking for the executable of the linux command source i can not find in the /bin nor /usr/bin nor /usr/sbin nor /usr/local/bin . I used whereis source it ...
0
votes
1answer
298 views

task manager performance tab

I am trying to have task manager open on the Performance tab on startup on Windows 8, 8.1, and 2012 machines. I have gotten the task manager to open, but it always does so on the Processes tab and ...
4
votes
4answers
3k views

Handy parsing for numbers with unit suffixes?

Let's say you have data with quantities in human-readable format, such as the output of du -h, and want to further operate on those numbers. Let's say you want to pipe your data through grep to do a ...