Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [command-line]

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

0
votes
0answers
12 views

How do I append whitespace to single-page pdf?

Consider the following two pdf files. $ pdfinfo coreBasedAPI.pdf Creator: TeX Producer: pdfTeX-1.40.18 CreationDate: Thu Mar 21 15:56:46 2019 PDT ModDate: Thu Mar 21 15:56:46 ...
0
votes
0answers
7 views

Are the only HOOKS available for me to use listed under the mkinitcpio -L command?

Are the only HOOKS available for me to use with my system listed within the output of the following command? $ mkinitcpio -L
2
votes
0answers
44 views

How to trim down Amazon Linux OS for more free space?

I use EC2 on Amazon Web Services. The OS of the t2.micro instance is a customized “Amazon Linux” with 1 GiB RAM and 1 vCPU. When accessing this instance via their Cloud9 IDE I find that by default ...
0
votes
1answer
51 views

How can I run multiple unix commands sequentially using a single shortcut command?

I usually go through files using the following commands: cd first pwd ls cd second ls This a more generic way of my work. Can I execute all the commands one by one by itself by calling "some secret ...
0
votes
0answers
15 views

Shutdown PC after remmina connection closed

I'd like my PC to shutdown straight after I close my remmina remote connection. I searched for solutions but remmina itself shows abnormal behavior. someprogram && sudo shutdown -h 0 Running ...
0
votes
0answers
34 views

cannot find Trash folder! Ubuntu 18.04

I am running a preinstalled version of ubuntu 18.04 but cannot find Trash folder. The typical places don't have the folder. ~/.local/share/Trash <-- does not exist /root/..../Trash <-- does ...
1
vote
1answer
22 views

Using terminal to zip unknown amount of packages with dynamic names

I am trying to figure out a solution for unix based systems (maxOS, Linux) to zip unknown amount of packages, ideally without requiring users to install any additional third party software. I have ...
0
votes
1answer
26 views

How to fix this command mass renaming files to match a text file [closed]

for file in *; do read line; mv -v "${file}" "${line}"; done < /var/www/html/uploads/songs.txt It works as in changing all 700 files. But it doesn't seem to do it in the correct order. I feel ...
1
vote
1answer
28 views

How do I mass remove certain characters from directory/file names

What's a command I could use to do this on fedora 29 I need to remove [,], and -. If possible just remove the characters. Otherwise I'm good with replacing them as '_' I have 2,400+ files and ...
0
votes
0answers
16 views

How to programmatically change settings of xfce4-terminal?

With terminal emulators like gnome-terminal, it is possible to change settings programmatically, from the command line using dconf and gconf. But I have trouble finding a similar mechanism for xfce4-...
-3
votes
0answers
26 views

Deauthentication not working [duplicate]

:~# aireplay-ng -0 0 -a (bssid) -c (client) wlp2s0mon I'm not getting the handshake. The client is not getting disconnected. Please can anyone help ?
0
votes
1answer
64 views

Print the output of an interactive command in a shell script

I am writing a CGI script to monitor the system state, so the information must be outputted to the terminal with echo or cat. The problem is, systat is an interactive command, so it doesn't print ...
0
votes
0answers
9 views

How to set microphone volume for specific channel via command line?

There is a tool pavucontrol which can be used to setup input device channel (left or right) level. For example, I can set left front channel to -18dB and right front channel to -10dB by using GUI ...
16
votes
4answers
982 views

Running a subshell from the middle of the current command

I frequently find my self in this scenario. I'm in the middle of typing a command and I need to check something else before I complete it. Is there a way to open a subshell of some sort with my ...
0
votes
1answer
24 views

Text file: find string, save string field to var, find 2nd string, replace field with var, repeat to end

I think this would best be done with AWK, but not sure. Its been stumping me all day how to do this. I have a text file with * delimiters between the fields on the lines. I need to search for lines ...
1
vote
2answers
40 views

Expanding only certain variables inside a heredoc

This is an extension of the question I asked . Passing directory from command line to shell script I have a script which writes another script using a heredoc. I need to be able to write unexpanded ...
1
vote
3answers
52 views

Sed add newline before last occurrence of brace?

I want to insert a new line before the last occurrence of brace. My text file looks like that "accounts": { "0x0000000000000000000000000000000000000008": { "builtin": { "name": "...
2
votes
2answers
47 views

Use of multiple <<<

I am wondering about the way the redirection <<< works in bash. I understand that it redirects the chain after it to the command before as if the content was in virtual file. Examples $ ...
0
votes
1answer
23 views

How to interpret lspci -tvv output

Extract of lspci -tvv on a server with GPUs: -+-[0000:b2]-+-00.0-[b3-b8]----00.0-[b4-b8]----08.0-[b5-b8]----00.0-[b6-b8]--+-05.0-[b7]----00.0 NVIDIA Corporation GP104GL ...
0
votes
3answers
57 views

How to copy an image from one directory to another in unix?

Okay so for a research project, I am charged with working on a digital video game that happens to be formed by the use of Unix and emacs (don't know if they are the same thing because I just started ...
0
votes
2answers
36 views

how do i add the creation of a directory to this cli command

I'm traversing a directory, looking for subdirectories, finding certain files, and copying them someplace else... I'm doing this: for i in `ls ./*/filename`; do cp $i ../test2; done This takes all ...
-2
votes
0answers
47 views

Quickly view e-mail attachments from the command line?

Description of the issue I'm in a terminal at least half the time and, while doing e-mail, that mostly means being ssh'd into a remote machine where I run the alpine e-mail client to check my various ...
-1
votes
3answers
51 views

Comparing two files and show the content

I have two files containing content like the following: File 1 OG5_126568 OG5_126583 OG5_126593 OG5_126596 OG5_126599 OG5_126609 File2 OG5_126568 psychrobacter_aquaticus.txt WP_021813339.1 ...
0
votes
2answers
34 views

Rename files with zero padded numbers while keeping extension using “rename” command

I want to rename files with zero padded numbers while keeping extension. Example a.abc b.cde c.xyz to be renamed as 001.abc 002.cde 003.xyz :~/x$ rename -n -v 's/.+/our $i; sprintf("%03d.jpg", ...
1
vote
2answers
31 views

How to setup my unpartitioned, unmounted SSD?

I am running a CentOS 7 server with a 500gb SSD. Via SSH i got this output [root@localhost ~]# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sdb1 33538048 33537160 ...
1
vote
2answers
37 views

How to recursively move one file type but only when another file type is also present?

In my directory tree, some subfolders contain both *.flac and *.mp3 files, but other subfolders contain only *.mp3 files. I'd like to move all of the *.mp3 files to another destination (a different ...
-2
votes
1answer
69 views

Running a pipelin in linux [closed]

I have this script #!/bin/bash module load bedtools/2.21.0 bamfiles=( /temp/hgig/fi1d18/1672_WTSI-COLO_023_1pre/mapped_sample/HUMAN_1000Genomes_hs37d5_RNA_seq_WTSI-COLO_023_1pre.dupmarked.bam /temp/...
0
votes
0answers
16 views

Inconsistent newlines in fish shell under Lubuntu 18.10

I have recently installed Lubuntu 18.10 and have found the qterminal messes with the behavior of the fish shell. Fish shell adds a newline to the end of commands who's outputs don't already end in ...
1
vote
0answers
31 views

How to modify blended video durations with a -filter_complex command argument in ffmpeg

Building off the solution provided in this thread, I'd like to know how to make simple modifications to a complex command argument which uses ffmpeg to interweave two videos by dissolving them into ...
0
votes
2answers
43 views

CLI run multiple commands and close terminal

I want to run the following commands and close the terminal: mysqldump -udatabase -pdatabase database > db.sql && zip db.sql.zip db.sql && rm db.sql && mv db.sql.zip /var/...
0
votes
0answers
16 views

How do you escape “-” in a command in the Shell (Zsh)? [duplicate]

I am trying to rename a file named "-a" to "a" using the command line (zsh shell). I have tried the following mv \-a "a" mv '\-a' "a" mv "\-a" "a" but got mv: illegal option -- a usage: mv [-f | -...
1
vote
1answer
24 views

Change Shell Font via Command

I play a lot of Nethack and I suspect that I'm not alone in preferring a larger font for it than I normally use for my terminal. I tend to use 12 for normal terminal stuff (vim or whatever) and 16+ ...
0
votes
2answers
21 views

Copy specified subdirectories

I have a bunch of folders in an external HDD and I want to copy a part of them. The folders have the following structure: A001A A003A A004A etc... ...and all the folders contain similar directories ...
-1
votes
0answers
21 views

Running a Script in Slackware 14.2 [duplicate]

I was task to run the script below: #!/bin/bash if [ "`echo $PATH | grep ::`" != "" ]; then echo "Empty Directory in PATH (::)" fi if [ "`echo $PATH | grep :$`" != "" ]; then echo "...
0
votes
0answers
38 views

How to display `top` results sorted by memory usage by a process in KB/MB?

I have known about top command. When I using this command, I got only the memory usage of a process in terms of PERCENTAGE(%MEM) only. Is there any option to get the memory details in terms of Bytes(...
3
votes
2answers
45 views

How to wrap a command such that its execution is throttled (that is, it executes at most once every X minutes)

I'm interested in wrapping a command such that it only runs at most once every X duration; essentially, the same functionality as the lodash throttle function. I'd basically like to be able to run ...
2
votes
1answer
45 views

A tool for monitoring progress and ETA of an arbitrary process

I'm looking for a tool that takes two arguments: a command to execute, and a target value The tool should then run the command continuously, look for a number in the output of the command, and ...
0
votes
1answer
55 views

Download zip file from remote HTTPS host using netcat

I'm trying to download a zip file from : https://download.sysinternals.com/files/ProcessExplorer.zip (no curl and no WGET). I want to do that by netcat i used this command : echo -e "GET https://...
3
votes
2answers
144 views

What does echo $? do? [duplicate]

In my terminal it printed out a seemingly random number 127. I think it is printing some variable's value and to check my suspicion, I defined a new variable v=4. Running echo $? again gave me 0 as ...
0
votes
0answers
37 views

How to run command recursively on files within directory and sub-directories within? [duplicate]

How can I run the command below recursively on all directories and sub-directories within? [someone@someones-pc ~]$ for i in *.mp4; do ffmpeg -i "$i" -i watermark.png -filter_complex "overlay=1623:25"...
0
votes
1answer
49 views

Name a series of directories after file names

I have a list of files named EX5_##.bak. I want to each one in a directory named EX5_##. Example EX5_01.bak EX5_02.bak EX5_03.bak and I want to put them in directories. So when I typy ls -l I ...
0
votes
0answers
36 views

tcpdump usbmon module output explained

Running the command: tcpdump -qAXni usbmon3 -s 0 I am getting this output: 02:32:04.781964 BULK SUBMIT to 3:16:4 What does the last number after the colon (4) represent? How can I identify it in ...
1
vote
2answers
56 views

Update file with multiple values automatically

I have a hosted zone and record set that route to multiple addresses. I'd like to update the record set with adding or removing one IP address in the list. Unfortunately, AWS CLI doesn't provide the ...
0
votes
2answers
41 views

What does the -l argument mean in tcsh?

I'm running a tcsh shell. I have questions about the -l option in set -l. When I look at man for the set command, I don't see the -l argument. When using tcsh shell, what does the -l argument mean? ...
1
vote
1answer
42 views

How to use the ls command to show all files except those ending in a specific string

I have a directory with files of all kinds and I wanted to use the ls command to list all of them, except those with a name that ends in .config, but I do not get how to do it.
1
vote
2answers
36 views

How to use regular expression result into another expression

I have two regular expressions i.e. command1 and command2 where i need to combine both expressions into a single expression using | for that command1 output should be passed to next expression. ...
0
votes
0answers
22 views

Select area on screen with pointer

Is there a command line tool that let one select an area with pointer and print the result to terminal? Much like with various screen capture tools, but I want the coordinates. For example x,y,width,...
1
vote
1answer
49 views

Terminal command to add a directory to many existing zip files

I am using the below command in Terminal, found here from this answer by @Theophrastus to zip all *.html and *.js files with the same name, while retaining the name of those paired files. How to zip ...
0
votes
1answer
47 views

FreeBSD: What is the counterpart to apt called?

I'm about to install FreeBSD 12.1. I'm a longtime Ubuntu user, and I prefer to install apps via the command line. Just wondering.
0
votes
1answer
333 views

How to use wc, grep and ls to list all files that are at least 10,000,000 bytes in a directory? [duplicate]

Now I find that wc -c could show the size of file, then how to select them and list them? It should be a single pipeline of commands.