Questions tagged [command-line]

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

Filter by
Sorted by
Tagged with
0 votes
2 answers
26 views

Using grep and command line argument

I have a file f1 with contents: james john joe marie james joe don marie I want to output the occurrence of the command line arguments in each line using grep in a shell script s1.sh with ...
user avatar
  • 1
0 votes
1 answer
26 views

SSH timeout does not happen

In Linux kernel 4.9.275,ssh version OpenSSH_8.5p1 and OpenSSH_8.7p1 session does not close automatically after specified time in clientaliveIntervl /etc/ssh/sshd_config. Is it bug? Kiran
user avatar
1 vote
1 answer
14 views

How to install gdb with no package manager?

I'm trying to reverse engineer some software on a system that runs embedded Linux. I've ssh-ed into it, and right now I'm trying to attach gdb to one of the processes so I can get some information on ...
user avatar
0 votes
0 answers
15 views

Extend the OS disk on Ubuntu 20.04

I have a VM on Azure with Ubuntu 20.04, the partitions looks like : # df -h Filesystem Size Used Avail Use% Mounted on udev 3.9G 0 3.9G 0% /dev tmpfs ...
user avatar
1 vote
1 answer
49 views

How can I pipe an alias that requires sudo through SSH?

I've set up so that I can SSH securely into my home PC from my laptop. Today, I tried running an update just to test, but I couldn't do it from the laptop. What I basically wanted to do, was to pass ...
user avatar
  • 1,020
0 votes
0 answers
19 views

Where is the "List files only" Nautilus' permission on terminal?

I found out that some folders may have the "List files only" permission on Nautilus. Others have "Access files". Both folders show the same on terminal, using ls -l command: drwxr--...
user avatar
  • 1,592
-2 votes
0 answers
17 views

cant install a leafpad and gedit in kalilinux using sudo apt get install.......can you please guide me?

run apt-get update Command 'run' not found, did you mean: command 'runc' from deb runc command 'srun' from deb slurm-client command 'zrun' from deb moreutils command 'zun' from deb python3-...
user avatar
  • 1
0 votes
0 answers
20 views

How to change the system refresh rate from the command-line?

Projectors appear to typically support 24p playback (incl. 23.976Hz less commonly, it seems) — currently I'm manually toggling between 24Hz and 60Hz in the Gnome settings when switching from film or ...
user avatar
0 votes
3 answers
45 views

Process the same stdin two time and append the outputs

I have a json file that looks like: [ { "key": "alt+down", "command": "-editor.action.moveLinesDownAction", "when": "...
user avatar
  • 1,339
1 vote
2 answers
25 views

substitute 2 substrings from a single line in a file into 2 different lines in a different file from command line

I have a text file with however many lines. One line is: fixed_stringA = 123, fixed_stringB = 456 I have a second text file (again with however many lines). These 2 lines are in this order, in middle ...
user avatar
  • 113
0 votes
1 answer
20 views

How to limit messages from the wall command to a specific group?

The description for the wall command states that it sends a message to all logged in users. However, the man page describes a flag, -g --group, which allows the sender to limit messages to a specified ...
user avatar
  • 5
0 votes
1 answer
38 views

Remove certain words and set word at end of string in files

I have a bunch of files that contain strings similar to: Get<1>(abc) Get<2>(xyz) How can I recursively search for all files with the above pattern and remove everything before the first '(...
user avatar
  • 101
0 votes
0 answers
12 views

autossh works in CLI but not with SystemCtl

I try to use reverse ssh on my Synology. I use this library: https://github.com/blondak/synology-autossh. Everything works when I launch this command directly from the CLI: /volume1/homes/user/...
user avatar
22 votes
4 answers
2k views

How can I repeat only a part of a command in bash?

I'd like to know if it's possible to just repeat part of a command. I.e. if I do ls /path/to/somewhere -a, I only want to remove ls and -a. I know that if I do !! it repeats the previous command (...
user avatar
  • 1,020
0 votes
1 answer
25 views

How to recursively delete the contents of all "node_modules" directories (or any dir), starting from current directory, leaving an empty folder?

Suppose I have a directory structure like this: projects/ project1/ src/ node_modules/ dir1/ dir2/ dir3/ file project2/ node_modules/ dir4/ Starting from ...
user avatar
  • 125
0 votes
0 answers
30 views

How to change Linux terminal prompt

I've been using Terminator as my terminal but after reconfiguring my display manager to 'Lightdm' after 'gdm3' crashed while installing updates, I messed something up, not with terminal, using the GUI ...
user avatar
1 vote
1 answer
38 views

Interacting with GUI from CLI (headless GUI)

I have linux server. I expect there's headless GUI that can be controlled by CLI for my server. I do know it possible display GUI with XRDP. But I expect I can control it with SSH or CLI. It works ...
user avatar
0 votes
1 answer
26 views

FLAC encoders – any difference in output between the command-line tools?

I would like to know if there is any difference in the final output between the various command-line tools for encoding FLAC files, like ffmpeg, sox, the “official” flac etc. In some contexts, I have ...
user avatar
  • 53
0 votes
1 answer
36 views

less command: b/f vs w/s

About the less and according with: Less command Linux / Unix Colored Man Pages With less Command indicates the following: f ^F ^V SPACE * Forward one window (or N lines). b ^B ESC-v * Backward ...
user avatar
5 votes
2 answers
448 views

less command g vs p option

In less for navigation purposes according with this tutorial Less Command in Linux indicates: g Go to the first line in the file. p Go to the beginning of the file. I tested both, and of course ...
user avatar
0 votes
1 answer
121 views

Blocking UDP port 140 from receiving packets from source port 8989 (active way to send signal to sender that is unreachable)

So my problem is that I want to block UPD port 140 from receiving packets from port 8989, but I want to block it actively, not just silently ignore it, but to send an active signal to the sender of ...
user avatar
1 vote
2 answers
57 views

Why this sed command prints all the lines?

Why this sed command: sed /^a/,/i$/p prints all lines and not just the lines that beginning with "a" and end with "i"? It is not too clear to me how sed /BEGIN/,/END/p works. STDIN:...
user avatar
2 votes
3 answers
828 views

How to know what are commands, system calls, bash built-ins, etc?

A coworker recently asked "What is man"? After being informed that not all things accessible from the Bash CLI are commands, I was wary to call man a command. man man just calls it an ...
user avatar
  • 14.4k
3 votes
1 answer
48 views

align data by word into column

How can I align data into pretty columns relative to given word? For example, I have output of the route -n command: default via 172.20.99.254 dev eth0 87.33.17.71 dev tun0 scope link 89.223.15.12 ...
user avatar
1 vote
1 answer
38 views

Retrieve last command when Chaining

When chaining commands in zsh using ;, && and ||, how can I access the previous command in chain (the command that is being executed before)? Example: rm foo ; echo ... In place of the dots, ...
user avatar
  • 13
1 vote
1 answer
271 views

Difference between sort -u and uniq -u

I always have been using sort -u to get rid of duplicates until now. But I am having a real doubt about a list generated by a software tool. The question is: is the output of sort -u |wc the same as ...
user avatar
  • 206
0 votes
3 answers
51 views

Can program notify itself any opened shell?

I am planning on write CLI program. This CLI program should have ability to run at scheduled time. Is it possible for this program to somehow notify user's shell? Sort of like mail tells you that you ...
user avatar
0 votes
1 answer
51 views

execute set of commands in group by {} vs () [duplicate]

I read this post: How do I run multiple background commands in bash in a single line? I understand the answer, but having the option to execute a set of commands through either {} or () makes to ...
user avatar
-5 votes
1 answer
61 views

in linux how to stop or suspend or hangup a job without using fg command or ctrl+z? [duplicate]

i am new on linux but i have an assignment and it requires to stop and suspend and hangup certain jobs without using the fg or ctrl+z commands like this picture and what does the dot after the number ...
user avatar
1 vote
1 answer
78 views

Run a shell command via tower-cli

Ansible CLI allows to run a custom shell command (done implicitly using the default module "ansible.builtin.command"): ansible myhost -a "/bin/mycommand" Is it possible to do the ...
user avatar
  • 25.9k
1 vote
1 answer
38 views

Fedora Offline-Upgrade shutdown instead of reboot from CLI

Before turning off my Laptop (which runs Fedora 36) I like to run sudo dnf offline-upgrade download -y && sudo dnf offline-upgrade reboot || sudo shutdown now So that all pending updates get ...
user avatar
  • 13
-5 votes
1 answer
49 views

How to make CLI applications in Unix? [closed]

How are apps like vim and w3m built? I was trying to find info about this online but I couldn’t really find much.
user avatar
-2 votes
3 answers
119 views

Creating a tar.gz archive of multiple directories of different locations -- "tar: Cowardly refusing to create an empty archive"

I'm trying to create an achive: $ cd /tmp $ tar -czf test1.tar.gz -C ~/Downloads/dir1 -C ~/Documents/dir2 -C ~/dir3/dir4/dir5 ... which is supposed not to preserve the full path of the directories in ...
user avatar
  • 19
1 vote
1 answer
28 views

I3 WM bindsym giving error but in terminal, works fine

I have this in my i3 config to restart picom: bindsym $mod+Shift+P exec killall picom; sleep 0.2; picom It works fine in terminal but when I press the keybinding, it shows error, and it just says you ...
user avatar
-2 votes
1 answer
37 views

Redirect the output to two different files, One should have new output whenever the commands execute and the other should have both new & old content

Redirect the output to two different files, One should have new output whenever the commands execute and the other should have both new & old content. For example: openstack port create --network ...
user avatar
  • 1,800
0 votes
1 answer
34 views

Run cargo command in subdirectories with user-specified arguments

I've a directory structure like: rust/ ├── dir1/ │ └── Cargo.toml └── dir2/ └── Cargo.toml I want to create a zsh script that'll run from the rust directory, and for each subdirectory with a ...
user avatar
0 votes
1 answer
38 views

Cannot append user to group

I'm having trouble adding a user to a group: # useradd -aG group user # useradd -a -G group user # useradd -G group user --append It tells me that the -a option is an invalid or unrecognized. Can ...
user avatar
  • 1,020
3 votes
3 answers
153 views

Every row of a file is converted to a new file

I have a file that contains four columns and 5000 rows. I want to make 5000 new files from this file so that each file has one row from the original file. Also, I want to name the new files according ...
user avatar
1 vote
0 answers
21 views

Split pdf document based on section

(This may be a XY problem, more on the context at the end) Is there any way of programmatically splitting a pdf based on the section titles? That is from this pdf, produce 2 pdfs, where one contains ...
user avatar
  • 366
0 votes
2 answers
23 views

What is the colon in postgres' process command-lines?

For example Postgres process command-lines are like postgres 794 1 0 Nov06 ? 00:00:03 /usr/pgsql-9.3/bin/postgres -D /var/lib/pgsql/9.3/data -p 5432 postgres 857 794 0 Nov06 ? ...
user avatar
1 vote
1 answer
45 views

How to get around 403 errors on websites with text-based browsers?

The issue seems to stem from a misconfigured web server and has affected some domains I've came across in lynx and w3m, but links can access at least in some instances. Can this be resolved on the ...
user avatar
2 votes
2 answers
164 views

Add new lines based on the columns of a tab delimited file

I have a tab-separated file like this: 211845 032 215979 002 071 217783 143 156 169 219750 111 For the lines that have multiple tab separated entries, I want to add new lines based on the ...
user avatar
  • 21
0 votes
0 answers
38 views

Start Graphical Interface

I recently subscribed for a cloud company and launched application server under debian 10.5 I wanna go from command-line to graphical interface, but I can´t I typed startx , but I got. I tried using ...
user avatar
-1 votes
1 answer
70 views

Find how many words in a file contain a number in them?

I am trying to find the total number of words in a specific file that contain a number. Not a specific number, I'm just looking for words that contain any number at all. I tried using the grep and ...
user avatar
  • 1
0 votes
2 answers
41 views

What's a clean way to run a specific command C for each line L of a given file F and then move every L where C(L) ran unsuccesfully?

Say that https://example.nosuchtld https://example.net https://example.org https://example.willfail is the content of urls.txt. I want to run <command> <url> for every URL/line of urls....
user avatar
2 votes
2 answers
137 views

Command line - save sub-strings conditionally

Can a command line utility save sub-strings conditionally in different files? I have a file (file.txt) with several lines like the following. 1/1_ABCD4.txt:20020711 1/1_ABCD10.txt:20020731 2/2_ABCD2....
user avatar
1 vote
1 answer
23 views

How can I use the terminal and track what is being changed?

I was wondering if it's possible to use the CLI to track the changes I am making in an app launched through the CLI. For example: Launch CLI. Enter gnome-control-center. Make random changes in the ...
user avatar
  • 1,020
0 votes
1 answer
23 views

How to redirect while ignoring some of the text

Some potential duplicates may be the following: How to ignore specific lines from being redirected BUT I can't extrapolate from that to solve my problem. So, I am asking here instead. So, here is what ...
user avatar
-1 votes
1 answer
48 views

How to download all repositories of a GitHub account to my personal computer without using github cli? [duplicate]

I use WSL Ubuntu 18.04 unchanged. I have one GitHub user with 6 GitHub repositories of that user. Basically I just need to download all my GitHub repositories as I wish to make a local backup of all ...
user avatar
0 votes
1 answer
37 views

Dynamically generate arguments for python script input

I call a python script with some command line arguments like: python3 script.py --run 1 --filepath "this/file/dir" I now try to parse the arguments from a config file with: grep -v '^#' ${...
user avatar

1
2 3 4 5
117