The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [command-line]

The command-line is the interactive interface to your shell.

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

xdotool not bringing active window in front while VLC is fullscreen

VLC media player has two options to show video in fullscreen. The first is called "fullscreen mode" F11 shortcut and the second is "fullscreen" with "f" shortcut. Both modes appear the same, but the ...
25
votes
6answers
29k views

“showmount: command not found”: how do I know what to install?

Sometimes you run a command and get a "command not found" error message. After that you try to install the package that contains that command (I think that's what happens anyway?) e.g. showmount: ...
1
vote
1answer
49 views

Does not work autocompletion on <TAB> in bash command line [closed]

When I tried to use auto completion in bash terminal with TAB, I have got the following error: bash: !ref: unbound variable bash: words[i]: unbound variable It is pretty annoying to manually enter ...
8
votes
2answers
18k views

Copying multiple files using rsync over ssh

I want to copying multiple files from remote machine using rsync. So I use the following command. rsync -Pav -e 'ssh -i sshkey' user@remotemachine:/home/user/file1.zip file2.zip file3.zip . It ...
0
votes
1answer
2k views

i3-msg how to execute a specific command right after termite startup

I'm using this command to start my i3 layout: exec --no-startup-id "i3-msg 'workspace 1; append_layout /home/michael/.i3/workspace-1.json'; exec termite; exec termite" I have two windows which ...
1
vote
1answer
75 views

How to create a google contact from command line?

I can use goobook to create a google contact with NAME and EMAIL but I need to add a PHONE.
35
votes
11answers
39k views

How to randomly sample a subset of a file

Is there any Linux command one can use to sample subset of a file? For instance, a file contains one million lines, and we want to randomly sample only one thousand lines from that file. For random ...
3
votes
3answers
1k views

Equation solver for the shell?

Is there an equation solver for the shell? For example, I enter input 1000=x^(1.02) and the shell solves for x.
0
votes
0answers
14 views

Import calendar file with korganizer from command line

How can I import a calendar file (say calendar.ics) to korganizer from the command line?
0
votes
0answers
20 views

Merge multiple ics Kalender files into one file

How can I merge from command line multiple .ics calendar files in to one ics calendar file?
37
votes
7answers
198k views

How to set custom resolution using xrandr when the resolution is not available in 'Display Settings'

I'm a new Linux user trying to change the screen resolution as there is no option under display. I have successfully managed to add new resolutions by fluke by following online guide. I don't have a ...
3
votes
1answer
184 views

Is there any control character or hack to prevent simple command line tools from showing subsequent data?

I'ld like to hide ugly data from being shown by command line tools like cat (and maybe simple text editors too) which often get confused by binary data. For example a VT100 terminal sometimes gets ...
0
votes
0answers
46 views

ERR_CONNECTION_REFUSED: how to show the cause

I am running an application (over and over again in a for loop) which is very heavyweight. I attempt to start the application via a python script. Sometimes when I do that, I get a ...
0
votes
1answer
41 views

Linux command-line to find duplicate files and only retain most recent

I have a directory which contains a huge number of XML files. They are labelled as filename_date_time_checksum.xml, which means I've got thousands of files which are identical but separated by ...
7
votes
3answers
18k views

configure gsm connection using nmcli

I have a system without X display and I want to use nmcli to configure my cell modem to connect to a certain apn. I can get it going with this modem just fine on Ubuntu (with X) and I would like to ...
1
vote
2answers
68 views

Looking for command line package for showing inline text-based menu selector with arrow keys

I'm looking for a tool for displaying inline menus in the shell which can be navigated with arrow-keys and enter. By "inline", I mean that the menu is displayed within the normal flow of stdout text, ...
73
votes
6answers
116k views

What's the best way to join files again after splitting them?

If I have a large file and need to split it into 100 megabyte chunks I will do split -b 100m myImage.iso That usually give me something like xaa xab xac xad And to get them back together I have ...
0
votes
1answer
40 views

How to resize a partition to its maximum capacity after partitioning it to half of its capacity?

After cloning a 1TB hdd "TO" a 2TB hdd, in which the 2TB hdd is now only 1TB... The following format will not allow me to resize it properly, to its max capacity. Seems as though it won't get resized ...
1
vote
1answer
489 views

util-linux's getopt ignores first argument

I followed the posts on stackexchange websites to parse command line arguments. My program only parses long arguments and all arguments are mandatory. Here is what I have done: getopt --test > /...
0
votes
1answer
58 views

Bash: pass batches of files to python script

I have a python script that takes a path where a bunch of text files are located to process them somehow. Since there are too many files I want to use batches using a bash script to pass just some of ...
3
votes
1answer
71 views

How to use variable in sed command

I am trying to delete two lines ( 7 and 8) from a .txt file. For this I am using following code:- #!/bin/sh Column="7" sed '"$Column",8d' myfile.txt > result.txt on running this script, I am ...
1
vote
1answer
51 views

Create a folder for each file in a folder without the folder itself

| folderA1 | fileA11, fileA12, ... folderA | folderA2 | fileA21, fileA22... | ... | ... I want to make a copy of it represented as: | folderA1 | folderA11, folderA12, ... ...
0
votes
1answer
1k views

Search a file for a string in multiple directories

Can someone please help me with a command to search a file for a string in multiple directories? I am searching for the VIP in httpd.conf in multiple httpd instances. I am using: find ./ -name "...
0
votes
1answer
46 views

Kernel Command Line Interface - kcli: What is it and why do I need it?

I saw several times a command line interface called kcli on embedded systems. After googling around I found a LWN article introducing the first patch shipping it: LWN - kcli But the article is not ...
1
vote
1answer
70 views

AWS s3 CLi grep command with special characters

I want to copy the whole log that are stored in the AWS S3 bucket if the following line is present: \"Key\" : 951332,\n I've tried escaping by trying this: aws s3 ls s3://bucket_name | grep "/\"Key/...
86
votes
16answers
401k views

How to connect to a serial port as simple as using SSH?

Is there a way to connect to a serial terminal just as you would do with SSH? There must be a simpler way than tools such as Minicom, like this $ serial /dev/ttyS0 I know I can cat the output from ...
2
votes
2answers
14k views

Specify file name with curl --upload-file

When uploading a file with curl's --upload-file option, how do I specify a file name different than the one on disk? With the -F option, it can be done like this, I think: curl -F 'file=@/path/to/file/...
6
votes
10answers
9k views

How do I parse out just the date from 2017-03-08T19:41:26Z?

I am trying to parse out just the date from 2017-03-08T19:41:26Z. The desired output is 2017-03-08.
0
votes
3answers
641 views

Print SHA sums without “-” at the end?

Is it possible to have SHA sums print without the - appended to the end? $ echo test | sha1sum 4e1243bd22c66e76c2ba9eddc1f91394e57f9f83 - <--- this "-" dash/hyphen I know we can use awk and ...
16
votes
4answers
23k views

How do I grep without leading whitespaces?

I'm greping through a large codebase, and leading whitespaces and tabulation seem to be quite annoying. Is there any way to get rid of it? grep -R "something" ./ E.g, instead of: foo/bar.cpp: ...
471
votes
4answers
166k views

What does “--” (double-dash) mean? (also known as “bare double dash”)

I have seen -- used in the compgen command. For example: compgen -W "foo bar baz" -- b What is the meaning of the -- in there?
10
votes
2answers
6k views

diff -r only for certain file types

Is there a way I can perform a recursive diff of two directories but only compare (in their respective places) files that match a specific filename or filetype predicate? E.g. I would like to do ...
0
votes
0answers
13 views

Can I set an option within a function scope only? [duplicate]

I would like a function to behave as a file / script. For example in the below: #!/usr/bin/env bash github_createRepo() { set -e set -u projName="$(basename "$PWD")" json=$(jq -n \ --...
0
votes
1answer
40 views

How do I fix the “processing-java: command not found” error in the terminal

I have installed processing-3.5.3 IDE but really want to use the Sublime text editor as my goto for processing sketches. What I have done so far: Install the "Processing" package in sublime. ...
101
votes
10answers
358k views

Is there a way to see details of all the threads that a process has in Linux?

For Windows, I think Process Explorer shows you all the threads under a process. Is there a similar command line utility for Linux that can show me details about all the threads a particular process ...
1
vote
0answers
113 views

Using gocr app fails with broken dependency errors

How to use gocr to convert .png to .txt please? Optical Character Recognition --- gocr 0.50 20130305 Copyright (C) 2001-2010 Joerg Schulenburg GPG=1024D/53BDFBE3 released under the GNU General ...
0
votes
0answers
17 views

UDP not working for secondary IP in ubuntu

I have dco-access named interface configured on VM based on ubuntu wherein I configured 8 IP from same pool, but only global dco-access accepts udp and no other IP from global secondary accepts udp, ...
1
vote
0answers
19 views

diffrence between .bashrc and .bash_profile and PATH [duplicate]

guys, I have a question I try to understand the difference between login and no login shell and .bashrc and .bash_profile I put PATH in .bash_profile it should be present only in a login shell but ...
1
vote
1answer
46 views

PBKDF2 not the same

I am trying to calculate a PBKDF2 hash, but am getting inconsistent results. Message: Hello Salt: 60C100D05C610E8B94A854DFC0789885 Iterations: 1 Key length: 16 Expected hash: ...
3
votes
2answers
10k views

How to use the 'date' command to display week number of the year?

I want the UNIX date to output: So this is week 35 of 2016. Here, of course, 35 and 2016 are outputs of the date command. I have tried the following: date +%U This printed out the current week ...
77
votes
8answers
457k views

Connecting to wifi network through command line

I am trying to connect to my WEP network just using the command-line (Linux). I run: sudo iwconfig wlan0 mode Managed essid 'my_network' key 'xx:xx:... hex key, 26 digits' Then I try to obtain an ...
0
votes
1answer
50 views

How can I remove patterns using sed command in a file?

I have a document and I want to remove all the patterns so that I stay with only some information, the producer/creator of that document. I managed to replace patterns with one word "PATTERN" so that ...
0
votes
1answer
2k views

How to activate a specific Terminator profile from the command-line?

I have saved a few Terminator profiles with different colors etc. How is it possible to activate a specific profile from the command line, or initially run terminator with a specific profile? The ...
0
votes
2answers
116 views

Ubuntu without GUI

I use Ubuntu in a VM on my MacBook Pro for deep learning. But that causes a wastage of my CPU (as it's in a VM PLUS with a GUI). All I do is SSH into the VM, as I never use the GUI and proceed with my ...
11
votes
5answers
3k views

Is gzip atomic?

Is gzip atomic? What happens if I stop the gzip process while it's in the middle of gzipping a file? If it's not atomic, and if I already pressed Ctrl+C on a gzip *.txt process, how do I safely ...
1
vote
2answers
43 views

output mixed alphanumeric input with grep,pipe and cat

I have a mixed wordlist as an input: azert12345 a1z2e3r4t5 a1z2e3r455 The command line I have tried to execute: cat file.txt | grep -E "[[:digit:]]{5}" --color What do I want to accomplish: Print ...
0
votes
0answers
45 views

output only the mixed alphanumeric input with grep,pipe and cat [duplicate]

I have a mixed wordlist as an input azert12345 a1z2e3r4t5 a1z2e3r455 what i need to do is to print only the mixed alphanumeric words mad of 5 digits and 5 alphabets like (a1z2e3r4t5, azert12345) ...
0
votes
1answer
26 views

Copying files from specific subsubdirectories based on subdirectory name into single directory then renaming

So here's an excerpt of my directory tree: |-- 20070214_014700.a | |-- info | |-- processed | |-- HH.EL..BHZ | |-- AZ.AS..HHZ | |-- (hundreds more) | |-- raw | ...
2
votes
2answers
72 views

Why doesn't wget url/mediafile.ext > medafile2.ext work?

I tried the following : [$] wget http://cdn.edgecast.steamstatic.com/steam/apps/256679148/movie480.webm > Conan1.webm [1:21:05] --2017-02-23 01:...
4
votes
3answers
10k views

How do I create a dialog with multiple text fields using zenity?

I want to crate a GUI for some command line programs and I need to get info from multiple text fields e.g. 'Username', 'Password' and a checkbox 'Sign automatically?'. I need to set particular ...