Questions tagged [command-line]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
9 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
2answers
42 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 ...
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 ...
0
votes
0answers
21 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 ...
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 ...
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 ...
0
votes
2answers
45 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 ...
1
vote
2answers
54 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 ...
0
votes
2answers
57 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
6answers
279 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 ...
1
vote
1answer
28 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&...
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 ...
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 ...
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 ...
0
votes
1answer
16 views

Sort block devices by most recently connected?

How can I block devices by the most recent added ones? No option in lsblk seems to have that functionality.
0
votes
3answers
101 views

System performance commands in Linux [closed]

How can I find determine real-time system performance parameters such as memory usage, CPU usage, disk usage from the terminal in Linux. I have asked Google but have not found a succinct suggestion. I ...
0
votes
2answers
63 views

Find searches only for the first matching entry

I have to find all directory paths with specific subfolders. The search pattern is as follows: find /foo/*/searched_folder/bar -maxdepth 0 -type d ̶I̶t̶'̶s̶ ̶w̶o̶r̶k̶i̶n̶g̶ ̶p̶r̶e̶t̶t̶y̶ ̶w̶e̶l̶l̶ ...
5
votes
4answers
355 views

How to count the number of bytes in a file, grouping the same bytes?

Example: I have the file "mybinaryfile", and the contents in hex are: A0 01 00 FF 77 01 77 01 A0 I need to know how many A0 bytes there are in this file, how many 01, and so on. The result could be: ...
0
votes
1answer
17 views

fzf: How to return “ID” / line numbers?

I have a set of lines (item + description) which I want to run through fzf -m. For example: item1: Some description item1: Another description item2: Yet another description After selection I would ...
0
votes
1answer
31 views

run a software with input file as symbolic link

I have a directory with thousands of files, and I want to run a software multiple times in different directories with the same input files without copy the input in each directory, I have created a ...
0
votes
1answer
24 views

Use reverse i search to cycle through only commands matching pattern

The contents of the command history file using history | less is: 555 ls 556 ls -a 557 echo "hello" 558 echo "hello again" 559 cd 560 pwd 561 echo "hello hello" 562 ls 563 echo "hello hello hello" ...
0
votes
0answers
17 views

Connect to WiFi with “networksetup -setairportnetwork en0 ssid password” without entering the password in plaintext?

How to connect to a WiFi network using networksetup -setairportnetwork en0 ssid password without using the password in plaintext?
1
vote
1answer
24 views

Hiding lines from getting displayed

Can anybody tell me how to hide an error output. For example. I want to hide the below lines from getting displayed on command line. Usage: grep [OPTION]... PATTERN [FILE]... Try `grep --help' for ...
0
votes
0answers
57 views

How can I prevent execution of a command in a Linux shell? [duplicate]

I am trying to find a way to do this: any command that does not match the pattern "hh update D*" will be blocked in folder /A/B/C Practical example of what I am trying to achieve: In folder /A/B/C, ...
1
vote
2answers
42 views

Keeping two offline data sets in sync

Suppose that we have two replicas A and B of a large data set in locations that don't have a good Internet connection. As a rule of thumb, let's say it's possible to transfer metadata but not actual ...
0
votes
4answers
46 views

Use grep to search for words beginning with non-word characters

The contents of the file testing.txt are: ls -a cmake --verbose verbose I want to use grep to look through this file and find only the word beginning with "--" i.e. the word "--verbose" However ...
0
votes
1answer
23 views

Can anyone help me figure out what this “find” command with curly braces is saying? [duplicate]

I found some old notes where someone suggest I run the following command to set some file permissions: find /perl/lib/ -type f -exec chmod o+r \{\} \; Would you happen to know what the \{\} part of ...
0
votes
1answer
22 views

pass a string with non printable char in hexa to a

I want to pass a string in hexa : 'c3:87:80:00' by instance to a binary I've tried : ./<bin> "$(python -c "print 'c3:87:80:00'")" and ./<bin> "$(printf 'c3:87:80:00')" I've also ...
0
votes
1answer
72 views

Is it safe to delete a binary in /usr/bin?

I installed the precompiled binary of a command line program in /usr/bin, now I want to install the same program using my package manager. In order to avoid conflict between the package manager dnf ...
0
votes
0answers
7 views

Launch Openbox actions through script or cli

I was wondering if it is possible to run openbox actions, like the ones that can be found on rc.xml like MoveResizeTo , through a console command so I can launch it from terminal or inside a bash ...
-2
votes
2answers
42 views

Command du -xh / | grep -P “G\t” explained?

Interested in switch -P what does it do? And "G\t" pattern explanation? Please do not explain du -xh or basics of command grep. du -xh / | grep -P "G\t" 5.1G /var/oracle/XE/datafile 5.1G /var/...
0
votes
1answer
35 views

Is it possible to put the output of one command into the middle of another [duplicate]

I am asking if there is a way to automatically put the output of a command into the middle of another. multimon-ng outputs: ZCZC-WXR-TOR-029037+0030-1051700-KEAX/NWS and i want that output to get ...
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 ...
0
votes
2answers
46 views

Recursively replace path in a files in directory, except binary files

How to recursively replace strings (location path) in the files in directory, except binary files? I tried command find . -type f -exec sed -i 's/foo/bar/g' {} + but it replaces also strings in ...
1
vote
1answer
30 views

How to properly solve “git-gui: command not found” on Arch Linux?

The Arch Linux git package installs git-gui under /usr/lib/git-core/. This means git-gui cannot be launched directly from the terminal without specifying the full path: $ git-gui bash: git-gui: ...
2
votes
0answers
23 views

extract last 5 mins of information from the log file

system date format: Thu Jun 13 12:55:18 EDT 2019 My log format: 193.118.26.141 - - [01/May/2019:00:08:49 -0400] "GET / HTTP/1.1" 200 27 can someone please help me, how to get last 5 minutes of ...
0
votes
1answer
58 views

Pass command-line result as an argument to next command

Trying to insert output from this: kubectl get pods | grep -Eo '^[^ ]+' | grep portal Into this: kubectl exec -it <here> portal bash Tried: kubectl exec -it `kubectl get pods | grep -Eo '^[^...
1
vote
2answers
44 views

My /usr directory is 100% full. Unable to download packages

What kinds of files are okay to delete in /usr directory without blowing up the server?? Is it possible to increase the size of /usr directory without blowing up server?
0
votes
1answer
26 views

Dig: connection timed out; no servers could be reached. But ping works?

When I try to run the dig command against either my servers IP or nameserver I get an error: root@kali2:/etc# dig q-type=soa @192.168.100.10 ; <<>> DiG 9.11.4-P2-3-Debian <<>&...
0
votes
0answers
32 views

Conditional deleting of duplicate files

I have seen similar questions, but it seems my desired result is not covered in the answers. I want to delete duplicates only if files share the same name. Something like: rdfind -deleteduplicates ...
0
votes
0answers
25 views

Getting Reboot instead of Shutdown on Linux Distros

I've seen this problem before, on the machine that i am having this bug i had Ubuntu and the same was going on but then i found a workaround that was to use ~# shutdown -P now instead of only ~# ...
1
vote
3answers
242 views

Why does a file move/copy function only move one file at a time when using the “*” wildcard?

function mv1 { mv -n "$1" "targetdir" -v |wc -l ;} mv1 *.png It does only move the first .png file it finds, not all of them. How can I make the command apply to all files that match the wildcards?
-6
votes
1answer
61 views

. (Kali) I’m stuck [closed]

I downloaded the latest version on my 2012 mac, and flashed it onto a usb with etcher, it booted just fine, and everything seemed okay, but then I went to proxy and a popup appeared: Alert! Network ...
-4
votes
1answer
48 views

Explain how these commands with pipe and dash work? [closed]

How (and why) do these commands with a pipe and a dash work exactly? pacman -Qqdt | sudo pacman -Rns -
2
votes
1answer
20 views

Creating new elements with xmlstarlet

I have been trying to to add new elements to an XML file. Original file: <levela> <levelb> </levelb> </levela> I'm trying to get the following result: <levela> &...
0
votes
0answers
16 views

Font not showing when I run fc-list[arch]

[wasiim@wasiim-PC fonts]$ ls adobe-source-code-pro encodings noto ttf-linux-libertine util cantarell gsfonts TTF ttf-tahoma [wasiim@wasiim-PC fonts]$ ls TTF fonts.dir fonts....
0
votes
1answer
32 views

How to identify available environmental variables for applications?

On Linux, the crontab editor can be configured to open with nano using the following command: $ EDITOR=nano crontab -e This "EDITOR" env is mentioned in the crontab manual, but is there a way to ...