Questions tagged [command]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
12 views

How to update all paths references and entries in all apps and locations in Mac OS Big Sur 11.2.3?

So We recently changed the name of our macOS user account and home folder in our environment following this article https://support.apple.com/en-us/HT201548 . It worked successfully. But, Now some ...
0
votes
1answer
48 views

I need to rename a file and insert a date

I'm trying to set a daily process to locate a file, rename it and insert the previous date in the file name. I want the file to be named "Filename_MMddyyyy.csv" with MMddyyyy being the ...
3
votes
2answers
203 views

Ansible command ignore creates

I use command module with creates on an ansible 2.9 role. However, sometimes I need to ignore the creates arg and re-run the command multiple times. Is there any way I can override the default ...
1
vote
0answers
14 views

Open url with parameters with cmd

I changed default program for .docx and set to myopenwith.bat So when I clicked to any docx, it will open with myopenwith.bat myopenwith.bat has this code: start firefox https://www.dropbox.com/search/...
0
votes
0answers
26 views

how to restrict users switching from su command

How can I restrict users switching by su command..? suppose there are 3 users (root,user1 and user2) only root and user1 can switch by using su command. root or user1 should not be able to switch to ...
1
vote
2answers
71 views

How to use expect command with .run program in replace for yes command

The program.run I'm trying to run: Asks 2 questions that need the answer "y" Asks a third question at the end which is "press any key to exit" In addition, it doesn't have the &...
0
votes
0answers
25 views

export only “wai” result in dstat

I would like to export only "wai" result in dstat command: [root@gtw2-au ~]# dstat -c 1 2 ----total-usage---- usr sys idl wai stl 0 0 78 21 0 Desired output: 21
0
votes
1answer
168 views

looking for an alternative to echo to write data to a file so it can be invoked via sudo

Background: when run on a unix box Tenable.io (nessus) will try to create a tag file in /etc/ with a unique string. Presumably so it can identify the machine if the hostname or IP changes. It does ...
0
votes
2answers
483 views

Azure App Service Plan - Specify App Size with PowerShell

I'm trying to deploy an app service plan (ASP) in the premium tier using powershell. I can deploy the ASP successfully but the ASP defaults to P2v1 which is not what I want. I need the ASP to be set ...
0
votes
0answers
13 views

Is there a command to list all active maldet scans?

I relatively often run 2 or more scans on a server simultaneously (unfortunately some servers contain many users that manage to get their files infected simultaneously) and on many of those occasions ...
0
votes
0answers
15 views

Cronjob stopped working. But cron and php script still work? [duplicate]

I did a ImageMagick install on my CentOS webserver and afterwards my cronjobs do not work anymore. I have cronjobs that executes php files. For example one cronjob execute every 15 minutes a php file ...
0
votes
0answers
34 views

BAT script to return server licenses at shutdown?

My office uses program licenses that have to be manually activated and returned, and people tend to forget to do this when they go home for the day, resulting in most licenses tending to be ...
0
votes
1answer
114 views

Find out who hold the fd of one file which has been deleted?

Currently, I run a Java program will call some C++ library, and I find that after some files have been deleted, there still some thread holds the fd such as 3515991655 0 lr-x------ 1 user ...
3
votes
2answers
287 views

Delete all files & directories in a folder except one file

I want to delete all files & directories in a folder say 'A'. But except one file in that folder say .keep. I have tried the following command. find A ! -name '.keep' -type f -exec rm -f {} + ...
0
votes
1answer
1k views

Powershell send-mailmessage logs

I need to debug Send-MailMessage command. In linux, I can see the logs of sending mail, via tail -f. There is an option to see the logs of this command? I want to send mail to an external domain, it ...
0
votes
1answer
1k views

Java installation error on Debian 8

I followed the instructions from this website: https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-debian-8 When I install jre and jdk it says: Reading package lists....
0
votes
1answer
44 views

Move one file in a folder to another folder and rename?? Cmd?

I am hoping to get some help with this, I am thinking of using Command Line to do the following: Move ONE file in a folder (that has hundreds of files) to a new folder (new folder is the folder this ...
3
votes
1answer
623 views

Windows Command - Delayed Expansion Syntax to Echo The VALUE of a Variable That Contains Another Number Variable

I am trying to echo the VALUE of a variable whose name contains another variable ($project!$project_number!_control) while using delayed expansion. I can't figure out the syntax to do this. Here's ...
12
votes
2answers
20k views

How to print the last line of a gz compressed file in the command line?

I have a lot of gz compressed log files which have generic names and I need to check the period of time they reflect. I know about the zcat | head but this works for the beginning of the file only. ...
2
votes
0answers
168 views

Disable FTP commands on a per-user basis

I'm in the process of configuring an FTP server, using vsftp. I wish to have a couple different users. Some of these should only be able to read files, others should only be able to put files and some ...
10
votes
1answer
19k views

Return only a HTTP status code from curl command

I want to just get a statusCode from CURL command response. When I use this command: curl -I http://uploadserver.ln/1.mp4 I want to just get 200 rather than this long result: HTTP/1.1 200 OK ...
0
votes
1answer
116 views

IFTTT segmentation fault [closed]

I'm doing an assignment for school using getop with ocelot, I have to count words and count the substrings in the document. I have the word counting working but I was not able to do the substring, I ...
2
votes
1answer
314 views

fdisk with a a single command fail in the second execution

I ran a script to format a disk with fdisk like this: (echo n; echo p; echo $number_part; echo $firs_sector; echo $second_sector; echo t; echo $format; echo p; echo w) | fdisk /dev/$disk when i ...
0
votes
0answers
438 views

Mail command in AWS EC2 ubuntu instance is sending emails to spam folder

Recently, i have upgraded my EC2 ubuntu instance from t2.micro to t2.medium in AWS to fight space related issues. Though the upgrade went well, mail command which was working fine in t2.micro started ...
1
vote
1answer
162 views

how to stop for loop on another tty

We are connecting to the same host via the same user. So, only our sessions/tty are different. If one of us starts a for loop such as:for i in *; do command $i; done, I don't know how to stop it. All ...
2
votes
1answer
233 views

get output of command execution in Rudder? [closed]

I'm trying to use a User Technique in Rudder to monitor if my nodes has pending package updates. I create a Technique that execute: /usr/bin/apt-get update && /usr/bin/apt-get list --...
0
votes
1answer
39 views

Linux Script command interpreting not working remotely

I have the below linux script(simplified): RUN_JAVA=$(which java) if [ -z $RUN_JAVA ] then echo "No Java found!" >> /tmp/output.txt else echo $RUN_JAVA >> /tmp/output.txt fi When I run ...
0
votes
0answers
23 views

Can't use assigned variables after command

I have the following script filename="network_list.txt" while read -r line do name="$line" ping_stat=$(ping -c 4 $name 2>&1) if [ $? -ne 0 ] then echo "...
2
votes
1answer
59 views

Disabling a CMD command for a User

Let's say there are two accounts on Windows, Admin and User. Im running a program which shutdowns system in some ammount of time (using shutdown /s /t). Is there any way to disable shutdown -a for a ...
0
votes
1answer
42 views

When I use uniq -u I get no outpput, but why?

When I run the following command, I expect to get the ip addresses of ASG member instances: current_servers=$(aws ec2 describe-instances --instance-ids $(aws autoscaling describe-auto-scaling-groups -...
2
votes
3answers
4k views

One liner to check if specific port(s) is/are open

Redis Quick Start states: Make sure the port Redis uses to listen for connections (by default 6379 and additionally 16379 if you run Redis in cluster mode, plus 26379 for Sentinel) is firewalled, ...
-3
votes
1answer
803 views

how to identify the last logged in user in Windows 7 / Windows 10

I am a user in a domain where there are lot of cloud machines available.Now the problem is these machines can be logged in by any people .Though I can restart these machines using the command shutdown ...
0
votes
2answers
3k views

WSManCredSSP setting cannot be enabled

Im trying to set up 2 Hyperv 2016 Server hosts on my local network for remote access, but I just cant get them going. Servers are configured properly - both running: PSRemoting (also tried -...
-1
votes
2answers
2k views

Remove “Cc: ” from mailx command

I have recently setup a mail server on my Ubuntu Desktop 16.10, and I made a script that when a specific user logs in, they will execute the script instead of bash. Here is the script: #!/bin/bash ...
0
votes
1answer
494 views

find command with type and max date age

Is there a find command flag where I can set a max date age for files. Example would be only files within the last 2 days Also, a command I was given was -type f what does -type f mean?
1
vote
1answer
1k views

Continuously tailing a rotating log file with date and time in filename

I have a log file in format log_name_YY-MM-DD_HH_mm.log. The log rotates every couple of hours and the new log is created containing the date and time of it's creation. Sometimes I need to tail the ...
1
vote
2answers
5k views

How to cp files from sources to destination without using alias or non-alias and without getting confirmation/prompts?

$ cp /source/* /destination/ cp: overwrite `/destination/file1.conf` Aim is to copy files from source to destination without getting prompt or using non-alias(/) method.
0
votes
0answers
238 views

Remove com port using devcon for loop

I started learning command line yesterday. My supervisor asked me to delete extra com ports. I was trying to delete com port using command line. Right now I am using devcon.exe that is a part of ...
-3
votes
2answers
131 views

Error executing help manual pages on Fedora 25 for all kind of man pages

[user1@testMachine ~]$ lsb_release -a LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:...
0
votes
3answers
335 views

Enable confirmation for commands with force flag

Is there any option to enable confirmation for the rm -rf . We had an alias setup for rm=rm -i so whenever we delete a file it asks for confirmation but when -f flag is supplied it will not asks for ...
1
vote
0answers
205 views

Windows Server 2012 Scheduled Task window title is taskeng.exe (but not always)

We have several scheduled tasks running console apps on a Windows Server 2012 machine. When many of these run, and the console command window appears, the window title is "taskeng.exe" but sometimes ...
1
vote
1answer
173 views

Setting IP that i have pinged to be a variable

I am having great difficulty with a batch file i am working with. With the update i received below, i use nslookup to return the IP of the address. Is it possible to extract the IP returned with the ...
-2
votes
2answers
41 views

windows executable and extract data from file

On my CD-ROM I have this file: ip.txt which has the content: ip="192.168.1.1" netmask="255.255.255.0" gateway="123.456.789.2" How can I extract from ip.txt the IP, netmask and gw and use as command ...
3
votes
1answer
3k 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 ...
0
votes
1answer
481 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
258 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 ...
-1
votes
1answer
716 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%\...
0
votes
0answers
28 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 ...
-1
votes
2answers
88 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
1answer
2k 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 ...