Questions tagged [command-line-interface]
A command-line interface (CLI) is a mechanism for interacting with a computer operating system or software by typing commands to perform specific tasks.
1,575
questions
104
votes
11
answers
109k
views
How can I get diff to show only added and deleted lines? If diff can't do it, what tool can?
How can I get diff to show only added and deleted lines? If diff can't do it, what tool can?
7
votes
4
answers
17k
views
Listing of files recursively with modified time in tree-like format
I'm looking for a single command to list all files recursively from a given directory along with its modified time. It would also be nice if it can produce output in a tree-like format as produced by ...
13
votes
3
answers
11k
views
Why `wc -c` always count 1 more character?
in tmp I type a single character,but wc -c shows 2,why?
2
votes
2
answers
7k
views
Printing a '$' (dollar sign) to a file
I want to echo/printf a dollar sign into a file - but echo $ > myfile or such does not work (not surprising).
I tried escaping it like echo \$ > myfile but it is also not working.
What is the ...
1
vote
5
answers
3k
views
AWS Windows EC2 instance does not recognize assigned IAM role
Initially I launched a brand-new Windows Server 2016 server EC2. I assigned a S3 full admin IAM role to this instance when launching it. I installed CLI on it. I started a CMD window, and typed in "...
2
votes
5
answers
34k
views
How to change my commandline locale after CentOS decided to change it?
So apparently, CentOS decided I was Dutch, and thus, should not have a English locale.
Apart from the fact that this greatly bothers me, I am having a pretty hard time actually changing it back. ...
27
votes
7
answers
78k
views
How to check IPv6 address via command line?
How do I check the IPv6 address via command line?
For IPv4 I simply use:
curl ipinfo.io/ip
This doesn't work for IPv6.
3
votes
5
answers
5k
views
Search and delete lines matching a pattern along with comments in previous line if any
I have a requirement to write a shell script in csh to search and delete lines matching a pattern along with comments in previous line if any. For example if my file has the following lines
Shell ...
1
vote
1
answer
4k
views
How to install packages from command line on Suse
What is the Suse version of apt-get or yum? Or how do I get one of them installed in order to install software packages from the command line?
A fairly intense session of googling suggests that it may ...
5
votes
3
answers
27k
views
Using ROBOCOPY to MOVE data around, not copy it
I have the following powershell script, which executes a few robocopy commands:
ROBOCOPY.exe $q3 $q4 /R:5 /W:15 /S /NP /MT:32 /XA:SH /XJD
ROBOCOPY.exe $q2 $q3 /R:5 /W:15 /S /NP /MT:32 /XA:SH /XJD
...
5
votes
3
answers
4k
views
How to detect current media type in CLI under Windows? (DVD-RW, BD-R, etc)
How to detect current media type in CLI under Windows? (DVD-RW, BD-R, etc)
I've tried with wmic cdrom get /format:list but no info about the current media type.
I want to detect if the disc is a CD, ...
0
votes
0
answers
28
views
How to establish VPN connection with two factor authentication from CLI
A VPN connection have to be established on demand from a bash script. GUI needed to enter two factor auth code. If you'll try to execute in terminal:
VPN_NAME=$(nmcli con|grep "VPN"|awk '{...
0
votes
1
answer
116
views
ssh from CL using keyfile from Windows client to Linux server
This sort of thing drives me crazy - hopefully obvious solution(s). Have keys on Win 10 laptop, and on one of my Linux servers. If I use puTTY, where I can explicitly browse to the keyfile on the ...
1
vote
2
answers
65
views
Get file system type in AIX
I want to fetch the file system types in AIX like NFS and all. du command shows just the file systems not their types. How can I do that?
4
votes
1
answer
6k
views
How to compile capacity and used capacity of an EMC VNX via CLI?
I'm automating a report that will essentially duplicate the information shown in the Storage Capacity Summary chart from the EMC Unisphere web interface. I need to perform this from the command line ...
0
votes
1
answer
1k
views
AWS EC2 How to install Windows Updates and Reboot computer remotely?
I want to run a command via AWS Run Command that downloads and installs windows updates on a remote Windows 2012 R2 Server instance running on EC2, and reboots the instance.
I tried suggestions on ...
0
votes
1
answer
234
views
How to set Wildfly/JBoss domain controller IP address in managed servers using CLI?
I'm trying to change the domain controller IP address in JBoss/Wildfly managed servers using the management cli, but the configuration either keeps unchanged or changes in the wrong way.
I can find ...
0
votes
0
answers
25
views
Can Wildfly/JBoss Management CLI with embedded host controller use a temporary local domain controller?
I need to use Wildfly/JBoss Management CLI to set up managed servers connections to the domain controller. It's under automation, so I'm using the Embedded Host Controller to avoid the hassle of ...
1
vote
2
answers
5k
views
How to get URLs for requests currently served by Nginx?
As the title explains, I want to know the URLs for requests that are currently being served by Nginx, all the answers regarding nginx_status endpoint talk about the number of requests, if possible I ...
16
votes
2
answers
5k
views
What does the "@" sign mean in ls -l output?
I have this output on MacOSX:
$ ls -l
total 40
-rwxr-xr-x@ 1 levente staff 52 30 Sep 15:38 pl
-rwxr-xr-x 1 levente staff 675 14 Feb 17:07 plplay
-rwxr-xr-x@ 1 levente staff 662 26 Jan 14:13 ...
56
votes
7
answers
136k
views
Force SSH to use a specific shell
Is there any way to force SSH to use a particular shell on the remote end, regardless of what the user's default shell is?
I've tried solutions akin to:
ssh host.domain.com /bin/bash -c 'complicated,...
0
votes
0
answers
118
views
How can I fix this Mysql login?
I have installed MYSQL community edition on Windows server, I also added the Environment variable to execute the mysql command.
The scenario is: When I try to connect to mysql using the CMD I get the ...
11
votes
11
answers
18k
views
Is there an easy command line tool for packet sniffing a single command on linux?
I'd love if there was a single command line tool for packet sniffing a single command in Linux. something like sniff dumpfile command so that you could just run the command you want to packet sniff in ...
127
votes
15
answers
160k
views
What's the reverse DNS command line utility?
What's the command to find the name of a computer given its IP address?
I always forget what this command is, but I know it exists in Windows and I assume it exists on the *nix command-line.
38
votes
11
answers
180k
views
How to take ownership of files from the command line?
Every so often I run into a file that I need to take ownership of. I normally use cacls for changing ntfs permissions, but it doesn't seem to do ownership. Under *nix I would run something like ...
0
votes
1
answer
469
views
How to check if a process is running or blocked on lock or I/O?
There are 2 instances of a script reported by ps.
How can I see in the command line if one of those (and which) is blocked on either I/O or on a file lock?
31
votes
3
answers
23k
views
Non-interactive creation of SSL certificate requests
Is there a way to create SSL cert requests by specifying all the required parameters on the initial command? I am writing a CLI-based web server control panel and I would like to avoid the use of ...
16
votes
3
answers
3k
views
Strange bash history behaviour when running multiple sessions
How is command line history stored when I use multiple terminal windows? I know it is stored in .bash_history but I can't see the logic on what history is used if I open new window.
It almost feels ...
15
votes
6
answers
91k
views
How do I convert wireshark capture files to text files?
How can I convert wirshark captures (.cap) files to text files or some format from which I can read the file and parse its contents ?
0
votes
1
answer
734
views
Script to cleanup Windows.old remotely
Problem:
A lot of older workstations on our networks are running out of hard disk space and I am looking for ways to stream-line the process of cleaning up some space. I understand I can use Disk ...
0
votes
0
answers
70
views
Connect to VPN Server from command line on headless system
Is there a (relatively) hassle free way to connect as a client to a VPN Server (which uses Cisco IPSec)? The client is a Debian headless system hence the connection needs to be established from the ...
0
votes
2
answers
10k
views
validate domain trust command, netdom trust /verify doesn't work
I have an external trust with my Active Directory domain. I want to validate the trust from a command so that I can do it remotely and don't have to open Remote Desktop and navigate to the AD domains ...
4
votes
3
answers
16k
views
How to get list of openstack Instances with Project name
My openstack setup is Mitaka version.
I want to list all the Instances with Project Name.
I tried with below command but it shows Tenant ID but not name.
nova list --all-tenants
0
votes
0
answers
15
views
How to invoke executable in remote container / computer
What I have
Web App that invokes executables on demand in separate process like WordToPdfConverter.Exe. Inputs are cli arguments and files passed as cli arguments, output is standard/error output. ...
0
votes
1
answer
152
views
Net group command
I'm working on an automation project, and I need to add members to a specific group using a command-line approach. Currently, I'm using the net group command like this:
net group "group name"...
0
votes
1
answer
171
views
Azure CLI `AZ LOGIN` ERROR: "Found multiple accounts with the same username"
I'm getting this error whenever I try to login to Azure via the CLI. Here are the details:
PS C:\Users\MyName> az login
Please select the account you want to log in with
(Now I get a popup ...
29
votes
6
answers
5k
views
Best way to remove shutdown command, but keep reboot
I have a raspi type device in a data center, and recently accidentally fat fingered and pasted a shutdown command into the wrong terminal on my screen. Is there a way to keep shutdown -r but remove #...
4
votes
4
answers
5k
views
Output directory tree as XML
HI all,
Is there a linux command which will output the structure of a given directory as XML? if there is, that would be awesome.
Thanks very much
2
votes
1
answer
217
views
Find which physical disks are in virtual disk from CLI
I have the following virtual disk :
# omreport storage vdisk controller=0 vdisk=14
Virtual Disk 14 on Controller PERC H730 Mini (Embedded)
Controller PERC H730 Mini (Embedded)
ID ...
2
votes
1
answer
4k
views
VSFTPD not behaving in command line, but fine in GUI (Filezilla)
I'm trying to use VSFTP 3.0.3-3ubuntu2 on an Ubuntu 16:04.1 install. I have done this so that an application on another server can run an automated script to pull files from the FTP server triggered ...
2
votes
1
answer
143
views
Save commands used in shell to a file
Someone is going to connect to my server and type some commands into the terminal. But after finishing his work, he deletes bash_history.
I am looking for a way to save every command entered into the ...
1
vote
2
answers
5k
views
How to enable dig to show status codes?
With default options dig shows the return status for a DNS query in the comment ;; ->>HEADER<<- ... status: NXDOMAIN:
ubuntu:~$ dig hosted-by.myinternetservices.com.
; <<>> ...
0
votes
0
answers
89
views
Create Windows Server with Openstack CLI
we´re trying to install Windows Server 2019 with Openstack CLI which generally works fine but after the server has been provisioned, a logon to the server is not possible. How to create the local ...
0
votes
1
answer
1k
views
How to confirm openssl is reading its config file
Is there a simple way of changing the openssl config file and confirming with openssl command line parameters to confirm that it is reading the configuration file? (I'm trying to confirm that the ...
0
votes
2
answers
905
views
Saving PID as part of the filename of nohup's output file
I want to save the PID of a nohup process as part of the name of nohup's generated output file.
This is going in the right direction, but only works if the process with it's ID is already settled, i....
29
votes
3
answers
61k
views
AWS CLI Command Line: How to use "--query" to output multiple source lines
I am using aws-cli version 1.7.8 to get the --query output to create one record that is derived from multiple lines.
In this case I am trying to get specific information from describe-instances.
In ...
0
votes
1
answer
544
views
With GCloud CLI -- how to list all instances associated with a particular schedule (i.e. resource-policy)?
Here is a picture of the WebUI for GCP, showing an "instance schedule" that has 3 instances currently associated with it:
How can I list those same 3 instances using the GCloud CLI?
I found ...
0
votes
1
answer
1k
views
resize "shrink" an .img file from the command line
Shrink an .img file from the command line
I need to be able to shrink the .img for use on other drives. I can do this using gparted, but do not always have a GUI, so I want to translate the gparted ...
0
votes
1
answer
121
views
What is the simplest way to set up shared/clustered read-write filesystem across servers?
What is the simplest way to set up shared/clustered read-write POSIX-compliant filesystem across servers where performance is not a major concern?
Suppose I have two Linux servers S1 and S2 and an ...
12
votes
8
answers
14k
views
How to remove 'Administrator:' from the command promt title
In Windows Vista, is there a way to remove the word 'Administrator:' from the title of a command prompt window?
The 'title' command just updates the part after 'Administrator:', so that will not do.