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.

2
votes
2answers
22 views

How to include custom command options in a bash script with $1 and $2?

I have a script myscript.sh #!/bin/sh echo $1 $2 which is used something like ... ./myscript.sh foo bar which gives me an output of ... foo bar but how can i make this script include custom ...
5
votes
8answers
303 views

Separate the element after every 2nd ',' and push into next row in bash [duplicate]

An example of my file looks like this: 201012,720,201011,119,201710,16 Output I want: 201012,720 201011,119 201710,16
1
vote
1answer
34 views

Linux command that continuously outputs string of text

At some point I used a shell command that continuously sent a very short string of text to the standard output, but at this moment I can't recall it's name. Its name was something very short, like '...
-1
votes
1answer
37 views

Redirecting with yes > /dev/null & top

I am following a tutorial yes > /dev/null & top Output I do not understand what this line is doing. Top only It seems that I have one process less. Why?
0
votes
1answer
65 views

How can I open terminal and run command automatically?

I'm in the terminal emulator. I want to open another terminal to run a specified command. gnome-terminal -e "zsh -c 'pwd; zsh;'" That runs pwd and zsh consecutively and successfully in another ...
3
votes
1answer
139 views

Why does my date output have “STD” as the time zone?

When I run date on my Ubuntu under WSL, it prints: Wed May 15 19:33:37 STD 2019 Why does this have the string STD in it? I can't find a timezone online with the abbreviation STD (for example here) ...
0
votes
2answers
40 views

Concatenate the Content of Files from Various Directories with a Blank Line in Between

I have the file dir1.txt that contains the names of the following directories: 2 3 4 Directory 2 contains files 2_1.txt and 2_2.txt Directory 3 contains files 3_1.txt and 3_2.txt Directory 4 ...
0
votes
2answers
40 views

Run ssh command without quotes

You can execute a command on a remote server using ssh user@host 'the command' but is there a way to execute the command without quotes? (I am on BSD and using OpenSSH)
1
vote
1answer
26 views

How do I save image produced by asciiview?

When I run command asciiview image.jpg I'm able to view image in the terminal and quit browser using q key. I've tried different ways to redirect the output of the asciiview image.jpg to the console ...
-1
votes
1answer
27 views

How can I run only a portion of a command line in a user built shell?

I make a shell that takes arguments in a command line with special conditions on what it is able to do. For example, anything that appears after the # character will be considered as a comment and ...
4
votes
1answer
199 views

stdout and stderr redirection to different files

How can I redirect stdout to 2 different files and stderr to another, different file? I want something like <my_cmd> 1> file1 file2 2>file3 I know: <my_cmd> | tee file1 file2 > /...
2
votes
2answers
50 views

find -exec and increment counter / progress

TL;DR: Q: How to keep a counter in find -exec loop ? My use-case: I need to move a lot of directories which are scattered around the place, so I do find . -type d -name "prefix_*" \ -exec sh -...
-2
votes
2answers
114 views

How to manipulate numbers in a file"? [on hold]

I attached both picture and *.txt file https://1drv.ms/t/s!Aoomvi55MLAQh1jODfUxa-xurns_ of a sample work file. In this file Reactions which only start with "r1f", "r2f", "r3f"......and so on. And ...
1
vote
2answers
50 views

how can I merge multiple column in one column and separated by '-'?

I have a table as below: 1 10 15 2 2 25 1 10 26 I like to merge them and make a new column in linux, like below: 1 10 15 1:10-15 2 2 25 2:2-25 1 10 26 1:10-26
0
votes
0answers
11 views

colorchange in less status line

based on this, this and this questions I have tried to build a status bar with a dynamic part (line number, file name etc.) and a static part. (I am old and can't remember the useful shortcut all the ...
1
vote
1answer
20 views

Connect to fastest open WiFi (that can reach the Internet) and keep looking if cut off?

I know this is a Very Bad Idea™️ with regards to security, I'm ok with that. (Everything is over SSL, so meh.) I have a small wandering Raspberry Pi powered bot, that I'd like to keep in touch with. ...
0
votes
0answers
25 views

Download specific Kodi version on Raspbian

I have installed minimal Raspbian on my Rpi 3. On top of that, I installed Kodi. So far so good. However, the add-on I want to use does not deal very well with Kodi 18 so I would like to install the ...
-1
votes
1answer
30 views

Clarification on the gpg command (No such file or directory)

I'm facing issues while executing the below command. Saying that No such file or Directory. I checked in the system and there were No such directory exist. gpg: can't open `/root/.secrets/...
8
votes
3answers
825 views

Adding command shortcuts to /bin

Is there any way to add custom commands to /bin? For example, I use docker container ls a lot, and would like to turn this into a shortcut command, like dcls. If I add a file named dcls to /bin and ...
0
votes
1answer
49 views

how can i make grep/find/locate beep as it finds each match

I am looking for files, since I added a backup external HD. I want to continue working elsewhere, while find/grep/locate find a file. As a match is found, I'd like to be alerted so that i can stop the ...
1
vote
3answers
84 views

List files and directories that a user has permission to

How can one list the content of a directory but only show directories and files that a user has Read access to? I have worked out this but it only lists files owned: find /dir/to/search -user ...
-1
votes
1answer
51 views

Folding terminal pager

Concept: a terminal pager, like less for example, that interactively "folds" and "unfolds" the input file (as in emacs outline mode). Folded, a recursive directory listing might show only the ...
0
votes
3answers
102 views

Safe way of running an equivalent to rm -rf * [closed]

I have a task which contain a series of manual steps. One of the steps is to execute rm -rf *. Everything in the folder does need to be deleted but this seems a little dangerous for example. if the ...
0
votes
1answer
27 views

Find string and make it bold in output E-mail

i have below code which check status of some services on linux rhel 7 and send email (output is different service status). i want to make specific string called "up" and or "NOT up" in bold and with ...
2
votes
1answer
173 views

gnu parallel how to use with ffmpeg

I have folder that contains some mp4 files I want to extract images from each of them in parallel and save it as: filename_number.bmp where filename is the input filename how to do that using ...
1
vote
1answer
42 views

How to include input file name in output file name in ffmpeg

I want to extract frames as images from video and I want each image to be named as InputFileName_number.bmp.  How can I do this? I tried the following command: ffmpeg -i clip.mp4 fr1/$filename%d.jpg ...
0
votes
1answer
46 views

Does the wc command strip the trailing line feed from txt files?

I'm currently building a replica of the wc command line call (in C). I have a file [tst.txt] and the C code to read that file. The wc tst.txt command responds with the output: 2 6 20 tst....
0
votes
1answer
76 views

Make process not exit, when exiting from SSH terminal

I just run bitcoind in centOS server. I run the following command nohup ./bitcoind > out & disown Then I exit the SSH terminal, and the process is automatically closed. Is there any way to ...
0
votes
0answers
23 views

A way to see your location history within the command line?

Similar to git's reflog, I'm looking for a way to see the directories I have moved through. I have lost something and I'm not sure exactly what happened, and something like the reflog is exactly what ...
0
votes
0answers
25 views

How to list all services (daemons) on a Unix system that can be started by current user, but that will run as root?

How to list all services (daemons) on a Unix system that can be started by current user, but that will run as root? I'm studying cyber security and plays with capture-the-flag machines to enhance my ...
0
votes
1answer
50 views

How do you disable XON/OFF flow control?

I issued a stty -ixon command which enables XON/XOFF flow control. There is a stty -ixoff command but that enables the "sending of start/stop characters". So once XON/XOFF flow control is enabled, ...
0
votes
2answers
52 views

Add three dot floating numbers in shell

I am trying to append 5.34.03 number to 5.34.04 by using the following command $ awk '{print 5.34.03 + 0.0.1}' 5.340.030.1 Expected output 5.34.13 I tried with many methods, eg. let, but it didn't ...
0
votes
2answers
47 views

Deleted a user but forgot to delete home directory and user files

I have deleted a user using userdel command, but I forgot to delete user files. Now I want to delete those files, how can I find and delete them?
0
votes
2answers
36 views

How to subtract every adjacent line from the 2nd column and keep the first one

I am creating a file via this command: awk '{print $2 " "$7" "$8}' REACTOME_EXTENSION_OF_TELOMERES.xls | awk '$8!="No" {print $1 " " $2}' | awk 'NR>1' | awk 'BEGIN { OFS=", "; print "Name" " " "...
0
votes
1answer
31 views

Recover comand is not working

I am trying to use recover command to recover my deleted file, however when I use it, process got aborted with below error: recover: No valid standard devices found; are you a privileged user? Please ...
1
vote
1answer
71 views

chcon: cannot access (file): No such file or directory

I'm taking a Linux course and I have no idea on how to get past this annoying error: chcon: cannot access path: No such file or directory But before that we had to define our virtual host Perhaps ...
2
votes
3answers
147 views

Getting out of while loop on console

I ran a command: while true ; do ..... ....... ; done on the Linux console/terminal, and now this while loop is continuously running. I have two questions here: How to get out of this while loop? ...
-2
votes
3answers
40 views

How to obtain certain lines from several texts simultaneously?

Suppose I have 100 texts under the same dir, i.e., text1.txt, text2.txt,...,text100.txt. I want to extract certain lines(e.g., first 100 lines)from each text, and save the lines to another new 100 ...
-1
votes
3answers
48 views

How to calculate mean of each 3 columns in data frame?

I have a data frame like this: > head(dat_sg2) DwoC_2318_norm.1 DwoC_2318_norm.2 DwoC_2318_norm.3 DwoC_3395_norm.1 DwoC_3395_norm.2 DwoC_3395_norm.3 DwoC_6154_norm.1 ...
0
votes
0answers
29 views

How can I edit sudoers file if I have lost permissions despite providing root password?

While working on ubuntu, I have edited sudoers file and allowed myself to run only mkdir, cd command. Now I am unable to execute, install any command. Even visudo is not working despite providing root ...
1
vote
1answer
29 views

Commands Not Found when Passed through SSH

System: Red Hat Enterprise Linux Server release 7.6 (Maipo), 3.10.0-957.el7.x86_64 GOAL: Collect configurations for data from multiple servers to validate they are the same. What Works: ssh $...
1
vote
1answer
63 views

dd: No space left on device

I was restoring a backup of my Raspberry Pi on a new micro SD card. The original card was 16Gb and the destination card was 16Gb, too. However, during the transfer dd complained that there isn't any ...
0
votes
1answer
38 views

Output of df contradicts output of du?

When I run the df -h command while SSH'd into my SUSE Linux box I get the following output: /dev/sdt1, with a capacity of 512G, is mounted on /usr/sap However, if I cd to usr/sap/<HANA server ID&...
0
votes
1answer
53 views

How to use the bash shell with Python's in place of /bin/sh

I have commands to execute in the terminal but I want to execute them directly from my python script except that my script it launches the commands on /bin /sh and my terminal on bash: just an ...
1
vote
1answer
98 views

“Forcing” a kernel panic from the terminal on Linux

I'm using Solus 4.0 (in a VM) and trying to make screenshots of "typical" kernel panic output ("BSOD"). The init system in Solus is systemd. I tried the following commands in the terminal without ...
0
votes
1answer
33 views

Parsing “mdls” output

The following script takes a user input (path to a mounted macOS volume such as /Volumes/Macintosh\ HD/) #!/bin/bash # Author: Swasti Bhushan Deb # macOS 10.13.3 # kMDItemWhereFroms.sh read -e -p "...
2
votes
2answers
97 views

How to grep all lines from one file in specific column in multiple other files?

I have one file: combined.txt like this: GO_GLUTAMINE_FAMILY_AMINO_ACID_METABOLIC_PROCESS REACTOME_APC_CDC20_MEDIATED_DEGRADATION_OF_NEK2A LEE_METASTASIS_AND_RNA_PROCESSING_UP RB_DN.V1_UP ...
1
vote
1answer
30 views

Element comparison between subsequent lines, assigning a value for each null output

I have an output which looks like this: ASCII file I want to pick up the last element from the rows that contain the string "Fe\s2b". But the thing is each occurrence of "H\s\s1\s\s\s\s\s\s4861.33A" ...
0
votes
0answers
29 views

How to extract only XML message from log file having text and XML message both

Below are the sample output: er : [com.rbsg.digital.platform.model.persistence.entity.EntityAddressDTO.individuals#263660] 2019-04-13 05:00:19.924 DEBUG LENDING_DIGITAL_CERT_STAFF_LBZ5_PROD_MM [http-...
1
vote
1answer
30 views

How to use asciinema offline?

How can I record and play asciinema screen recordings in a LAN without internet connection? The tool uploads the recordings per default to the asciinema website but I want to keep it local and run ...