Questions tagged [command]
The command tag has no usage guidance.
186
questions
0
votes
0
answers
176
views
systemctl restart command fails
The server is a VPS running CentOS 7 64bit.
I'm trying to get the server to execute Perl scripts called by a browser (CGI). To this end I have a thread on the webmasters forum. But while trying to ...
0
votes
0
answers
55
views
Borg-Backup failed with Command in authorized_keys behind a ssh-tunnel?
I setup a PoC for a pull backup with Borg Backup.
In this example a client can only reach the backup server behind a proxy server.
In this case the server where Borg Backup is running open a temporary ...
0
votes
1
answer
32
views
Subcommand in dockerised app exits with `exit code 1`
I have an application. The application is working on Linux, but I plan to migrate it to the docker container.
I developed some modules that can use embedded PostgreSQL instead of a regular Postgres ...
-1
votes
1
answer
578
views
fetch between brackets on json with grep
i have the following json data
"url": "https://www.etsy.com/listing/812858182/59ft-x-84ft-moroccan-rug-mrirt-rug-beni?utm_source=etsymeter&utm_medium=api&utm_campaign=api",
...
-1
votes
1
answer
77
views
filtering result text with linux command
I would like to know how could I filter the result from a large text with Linux command
example text :
dmade Moroccan Rug, Beni Ourain Rug, White & Red Wool","sku":[],"...
0
votes
1
answer
1k
views
Retrieving Active Directory Users with no Email address from a certain group in powershell
I'm trying in powershell to output all AD users from a certain group with no data in the email address field.
I have the following command:
get-aduser -filter * -properties * | where {!$_.emailaddress}...
0
votes
1
answer
2k
views
ping: Warning: time of day goes back (-203647us), taking countermeasures
I'm getting the below weird warning message sometimes when pinging to 8.8.8.8 (Occurrence is very low). Any idea about the root cause?
$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 ...
0
votes
1
answer
301
views
How to know in my network which computers have the local administrator account active
As the title says: How do I know in my network which computers have the local administrator account active? Because, as per security consultant request, we have to know, and if possible, disable, ...
0
votes
1
answer
54
views
Linux cli pipeline command tail and grep
I am using tail to monitor a log file and using grep to filer the keyword.
tail -F somefile.log | grep "keyword" is working
tail -F somefile.log | awk '{print $4}' is working
but if to put ...
1
vote
1
answer
1k
views
Net User Command: Searching for list of users?
I am using this command
net user joe.blogs /domain
what syntax do I use to search 20 users? How to separate the names to make it search for the users?
0
votes
1
answer
401
views
exec 2>&1 – execlude some command from being logged to file
I have the following in my bash script:
# catch input for log-data
exec > >(tee -i ${LOG})
exec 2>&1
I want to exclude one command from being written to this log file,
but the following ...
0
votes
1
answer
379
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 ...
4
votes
2
answers
2k
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
0
answers
668
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
1
answer
727
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
2
answers
413
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
1
answer
691
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
2
answers
2k
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
0
answers
63
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
0
answers
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
0
answers
57
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
1
answer
360
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
2
answers
551
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
1
answer
4k
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
1
answer
2k
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
1
answer
65
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
1
answer
1k
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 ...
18
votes
2
answers
48k
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
0
answers
371
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 ...
29
votes
1
answer
52k
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
1
answer
122
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
1
answer
420
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
0
answers
565
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
1
answer
224
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
1
answer
289
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
1
answer
61
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
0
answers
30
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
1
answer
75
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
1
answer
74
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
3
answers
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
1
answer
888
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
2
answers
4k
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 -...
7
votes
1
answer
16k
views
What is difference between */5 and 5 for minute value in crontabs?
I have cron with following definition.
*/5 * * * * /somescript
What is the difference between them? Is second one running every 5 minutes and first is running 5 minutes after every hour?
-1
votes
2
answers
3k
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
1
answer
1k
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?
2
votes
1
answer
2k
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
2
answers
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
0
answers
389
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 ...
-2
votes
2
answers
142
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
3
answers
555
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 ...