Questions tagged [command-line]

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

Filter by
Sorted by
Tagged with
3
votes
2answers
33 views

Quickest way to move a line in a text file before another line in a text file?

I have the line number 55 in a text file which I want to move just before line number 23 in the same text file. I know that you can move lines up by a certain number of lines 1, 2 but is it possible ...
3
votes
1answer
356 views

What is the meaning of the string **/* when used with grep?

I came across this picture (below), obviously it is a pun or some kind of allusion incorporating command-line expressions. Frankly speaking I do not understand anything of it except for grep -n. ...
50
votes
5answers
132k views

How to avoid the need to issue “y” several times when removing protected file

I'm looking for a solution to be used as a response to "rm: remove write-protected regular file [x] ?" I was thinking of issuing a character followed by carriage return for several amount of times, ...
71
votes
7answers
137k views

How to use command line to change volume?

I am trying to control the volume using my programming script. How can I do the following in Fedora 15, Ubuntu linux? Mute/ Unmute Volume up and volume down Note: Please note that I use a web USB ...
0
votes
1answer
31 views

Efficient way to output text file lines into a directory tree

Example: test.txt coolname lineinfile Output: coolname would be placed at c/o/o/l/n/a.txt lineinfile would be placed at l/i/n/e/i/n.txt Any help would be appreciated
0
votes
2answers
20 views

Using command line in Fedora to print/echo certain lines in a file [duplicate]

For Fedora OS I'm still learning here, but I need help to insert a command for example "XXX" to say that I have a file that contains 1000 lines of single product names. I need to write a command to ...
1
vote
1answer
18 views

How do I add a new mime type for file -i?

On our server, we have some issues with mime types. I need to add the mime type for Microsoft Publisher files, so that file -b -i theFile.pub prints application/x-mspublisher to the command line. I ...
-2
votes
0answers
34 views

txt file returning zero [on hold]

When I run the following command the file LatLon.txt should return the Latitude Longitude value stored in it but instead it returns value of zero (0.0000,0.0000).
2
votes
1answer
166 views

/bin/sh: 0: Can't open sh

I'm trying to run a simple C program. #include <stdio.h> #include <unistd.h> extern char** environ; int main(){ // execl("/bin/sh","sh","-c","/bin/ls -l",(char *) NULL); char* argv[...
1
vote
1answer
54 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-...
0
votes
0answers
30 views

start executable without “open” cmd

I installed (using make...) a very interesting text editor called "aoeui" by peter m klausler on my OSx Mojave 10.14 https://sites.google.com/site/aoeuiandasdfg/ I can start it in the terminal with "...
0
votes
6answers
286 views

On Linux terminals, why doesn't cd.. work?

On Windows/DOS terminals a cd.. works well. On Linux terminals the dots from the cd command have to be separated. I'd like to know how/why is this necessary for the parser to work. If no space is ...
0
votes
0answers
10 views

Wifi problem with my Enhanced beaglebone : debian 9.4

I am working with sancloud Beaglebone debian 9.4, I am trying to scan wifi and connecting. I am using a connman command line interface, After scanning Wifi, I can't find the router wifi,but I found a ...
0
votes
1answer
1k views

Copy specific folders via lftp

I want to copy data using lftp login from server. Here is my command to copy all the data. lftp -u uid,pwd -e 'mirror -c /home/dcr96/TCGA' sftp://rob2056@serapeum2.qib.pbtech This copies the data ...
-1
votes
1answer
83 views

What is a system tool? [closed]

I frequently come across the term system tool, so I wanted to understand the exact meaning of it in Linux. Which of the following three explanations of a system tool in Linux is correct? Is a system ...
7
votes
2answers
871 views

How to make sure OpenVPN is connected?

I need some sort of "safeguard" for my VPN connection. If the connection drops, the machine shouldn't even reach the internet. (I can reach the machine by other means.) Is it possible somehow? If I ...
119
votes
36answers
56k views

Quick directory navigation in the bash shell

I would like to frequently switch between directories that are in totally unrelated paths, for example /Project/Warnest/docs/ and ~/Dropbox/Projects/ds/test/. But I don't want to type cd /[full-path]/...
0
votes
2answers
43 views

How to remove everything after the 2nd underscore but keep the other columns?

my file.txt looks like this variant_id pval_nominal 1_752721_A_G_b37 2.23485e-05 1_900397_C_T_b37 3.04603e-05 1_928297_G_A_b37 2.12455e-05 I am trying to remove everything after the 2nd underscore ...
4
votes
1answer
169 views

is it possible to colors the prompt for (reverse-i-search) context menu?

I am using fedora 25 but I think this is a general behavior on unix system. When I ctrl+r in a command-line environment I can start to type in and anything I type will get to be matched backward in ...
47
votes
6answers
205k views

Connect to a Bluetooth device via Terminal

I'm using Mint 15 w/ Cinnamon. I bought a set of bluetooth speakers and I'm trying to connect to them via terminal. Via the GUI I can see them normally and I am connected to them. I want to make a ...
0
votes
1answer
33 views

Pass piped command line to xargs

I have this command line: curl https://token-api/42 | awk '{ print $0 }' which produces this output: {"id":"PX-12345","expiresAtUtc":"2020-07-05T06:55:52","createdUtc":"2019-07-15T06:55:52"} The ...
4
votes
1answer
103 views

How to set shell to wrap words for long commands?

I connect to a Slackware server. When a command is longer than the size of the putty window, the line continues in the same line, and the start of the command disappears as I continue adding to the ...
2
votes
2answers
35 views

Changing the date format within a CSV file

I have a program that outputs data in the format date, time,field1,field2,field3,fieldn 12/20/14,08:01:53,318.622,0.93712,21.6867,1.1089 the file has many columns which all need to stay the same ...
1
vote
0answers
25 views

How to configure Atom for Python?

I installed atom-python-run for running python in Atom. But when I installed python extension in VS Code, then a massage came in that pylint not installed. And I clicked in install button. then a ...
19
votes
2answers
27k views

What is the meaning of read -r ?

in order to understand another answer: find / -type d -print0 | while read -r -d ''; do ls -ltr "$dir" | sed '$!d' the first step is to understand the usage of the option -r of the read command. ...
73
votes
10answers
116k views

Sorting files according to size recursively

I need to find the largest files in a folder. How do I scan a folder recursively and sort the contents by size? I have tried using ls -R -S, but this lists the directories as well. I also tried ...
0
votes
2answers
67 views

Why does the command 'source' have that name?

I wonder why a command that executes commands from a file in the current shell is named source. I can't see a relation between run commands in the current shell and the meaning of the english word ...
30
votes
10answers
36k views

Terminal-based spreadsheets and wordprocessor?

Are there any (good) terminal based (ie. runs in a VT, not in GUI/X) spreadsheets or wordprocessors for Unix/Linux? Can anybody remember the name of such programs which were popular before (eg. ...
5
votes
2answers
3k views

Is there a way to use regex expressions to auto-fill filenames in bash?

Assuming I have a directory with files as shown: $ ls file0001.txt file0002.txt file0003.txt file0004.txt file0005.txt someotherfile.txt Lets say I want to run the following command: $ cat file0001....
0
votes
2answers
48 views

Debian 10 — adjust sleep settings via command line

I have a machine that I access only via SSH that I just updated to Debian 10 a couple of days ago. Since the update it seems to be going to sleep when it is inactive. This has never happened with ...
234
votes
24answers
589k views

What is the fastest way to view images from the terminal?

The terminal is very fast and convenient way to quickly access directories and files (faster than find and click on the directory). One thing that it cannot show in text-mode is "pictures". What ...
32
votes
6answers
53k views

find n most frequent words in a file

I want to find, say, 10 most common word in a text file. Firstly, solution should be optimized for keystrokes (in other words - my time). Secondly, for the performance. Here is what I have so far to ...
0
votes
2answers
1k views

Best way to create table-like CLI display in Bash?

I'm working on a Bash script for massive USB flash memory testing (using f3 under the hood). I need to display a table-like interface with multiple columns and cells. Currently I'm using printf with ...
1
vote
2answers
58 views

How to interpret Unix command?

I have a command which looks like this: cat PGC2.SCZ.1.dat | awk 'NR == 1 || $NF < 0.05/1783' so this part I guess means skip the first line awk 'NR == 1 but what does this refer to? || $NF &...
0
votes
0answers
11 views

GRUB fails to boot arch linux?

I have a problem with my installation of Arch. I had recently uninstalled it as I wanted a clean install. I installed it up to the point of rebooting after installing and configuring GRUB with ...
1
vote
1answer
887 views

Thunderbird operations through the command line

Is there are way to trigger certain Thunderbird operations through the command line? I am in particular looking for a way to: Receive mail (Shift+F5) Filter on a particular tag Can this be done by ...
0
votes
2answers
62 views

Finding the smallest index such that the indexed log file does not exist in a particular directory

Question: Suppose there is a folder with files log1.txt, log2.txt, log3.txt, etc. I would like to find the smallest integer N such that log<N>.txt does not exist. Is there a simple command/way ...
0
votes
5answers
55 views

Putting a command inside awk to merge columns of different files

I have a file.txt for example (it does not have the same number of columns for each row): 1 2 3 4 5 5 6 7 7 7 7 9 10 I have another file (file2.txt) that contains 2 columns a b c d e f ...
4
votes
1answer
5k views

How to submit a job to a specific node using Slurm's sbatch command?

Our nodes are named node001 ... node0xx in our cluster. I wonder, is it possible to submit a job to a specific node using Slurm's sbatch command? If so, can someone post an example code for that?
1
vote
1answer
32 views

Understanding fetching mutiple URLs and documents using curl

It's not clear to me how to fetch multiple documents using curl mainly because I do not fully understand the explanation in the curl documentation The curl documentation says: -o, --output <file&...
3
votes
2answers
1k views

How can I merge 2 disk images into one with 2 partitions?

I have 2 (relatively small) disk images for qemu (raw format) containing different filesystems (say fat and ext4). I want to put them into an usb stick as two different partitions so that I can plug ...
-1
votes
4answers
6k views

cannot move Directory not empty

Edited due to people want to know more then me just wanting to know how to deal with two directories with same names in different places and move one into another when mv will not allow it if files ...
3
votes
2answers
8k views

How to reinstall all installed packages with zypper

How do I tell zypper to reinstall all currently installed packages?
1
vote
1answer
1k views

Save cached video on firefox?

I found a script on the internet that allows me to save cached flash files. https://github.com/janosgyerik/shellscripts/blob/master/bash/save-flash-linux.sh This would allow me to run the command ...
2
votes
2answers
3k views

Failing to Enable UARTs on Beaglebone Black

Short and General Question I'm running Debian 9 (Stretch) on a Beaglebone Black with kernel 4.9. I have tried following the instructions that I've found online, but have thus far been seemingly ...
0
votes
1answer
27 views

Repeat commands with changes

I have to repeat this command a lot of times a day, is there any way to execute it multiple times (aprox. 25 times) cd ../folderName && ../../tools/clone.py What I need to do is execute the ...
0
votes
2answers
37 views

how can I call a script with spaces in a variable in zsh?

this works as expected in bash: > t="ls -l" > $t #== ls -l > "$t" #== "ls -l" ls -l: command not found But in zsh I got this: > t="ls -l" > $t #== "ls -l" ls -l: command not found ...
9
votes
3answers
14k views

grep: input file 'X' is also the output

I use ubuntu 14.4, and attempt to redirect the output of grep command to a file, but I keep getting this error: grep: input file 'X' is also the output I've searched for this issue and just found ...
0
votes
1answer
25 views

group list by last string of each line

I'm having a list of strings (sorted IP address ranges) like this: 10.100.0.0-10.100.255.255 External: 2.2.2.2 10.120.0.0-10.255.255.255 External: 2.2.2.2 10.0.0.0-10.255.255.255 External: 3.3.3.3 ...