All Questions
Tagged with command-line linux
2,723
questions
1
vote
0
answers
23
views
How to Identify and Terminate Idle tmux Sessions on a Debian Server
I have a Debian server with multiple tmux sessions running. Some of these sessions are idle and not running any active processes. How can I identify and terminate all tmux sessions that are not ...
0
votes
0
answers
11
views
Keyboard doesn't work correctly when booting the linux kernel with single mode from CFE bootloader using UART
I've been encountering a specific and weird bug that i honestly can't seem to find any solution for, i've been toying around with this blu ray player and found a uart port, i wire it to my pi pico ...
0
votes
1
answer
18
views
How to increase VLC RAM buffer for offline files using CLI?
I would like to do the same thing as in the answer to this question: I want to increase the File Caching option found in the preferences (Tools -> Preferences) with all the parameters (the All ...
0
votes
0
answers
64
views
How do you remove stubborn (album art) / (embedded images) that eyeD3 misses?
How do you remove stubborn (album art) / (embedded images) that eyeD3 misses?
Running:
$ eyeD3 --remove-all-images . #
Works great 90% of the time but not 100% of the time.
I’d prefer a command that ...
0
votes
0
answers
33
views
Is there a name for the text that shows up after executing each command line in a CLI?
for example in linux terminal I have
jurek@debian:~$ man help
No manual entry for help
I want to know how the second line is called
bc I want to ask an other question "How to copy this term (I'm ...
1
vote
0
answers
35
views
How to output lines with ex command that is vi not vim?
I am using ArchLinux and I want to run some ex commands. The following outputs nothing on my system:
$ ex -s -c %p -c q /etc/hosts
The ex command is a part of vi package on my system:
$ pacman -Ql vi
...
0
votes
1
answer
91
views
I want to change the track and title of mp3 files using their ID3 Tag data in all sub directories too not just the folder I am in
I want to change the track and title of mp3 files using their ID3 Tag data in all sub directories too not just the folder I am in.
To change track and title in a single folder sometimes kid3-cli or ...
1
vote
1
answer
37
views
Generic way to open $EDITOR at a specific line
I'm building a CLI application where you're supposed to be able to open files at particular lines.
I noticed that many applications (vim, nano, kakoune) use the + argument to allow you to open a file ...
0
votes
1
answer
112
views
ls -ltr on the terminal lists the files but says "No such file or directory" in a shell script
I am new to Bash and am practicing some shell scripts. I wanted to write a script to list all the folders and their file count, if a root path is passed as a parameter value from the terminal. The ...
0
votes
0
answers
50
views
Display new prompt after tty redirect on second terminal
I'll try to explain the title better :)
I have two terminals tty1 and tty2, let's call them that.
From tty1 I redirect the output from echo to the tty2 terminal with:
echo hello > $(tty2)
This ...
17
votes
2
answers
4k
views
How does ls know how to output its results?
While creating a bash script, I found that this code ls puts all files on one line:
pi@raspberrypi:~/ptlrestinterface$ ls
update.sh web.config MyApp.runtimeconfig.json
still ls | head -n1 ...
0
votes
1
answer
33
views
sed does not consume rest of the line
I have one line of different words stored in a txt file
N/A 9.0 Yes Yes N/A N/A N/A N/A 8.8 Yes Yes N/A N/A N/A N/A 8.7 Yes Yes N/A N/A N/A N/A 9.2 Yes Yes Yes Yes Yes Yes 9.1 Yes Yes Yes Yes Yes Yes ...
0
votes
0
answers
120
views
MacOs equivalent of adding a user to the linux dialout group on for permissions setup for UART communication
I'm working on a project where I'm interfacing with some hardware and want to monitor the data from some sensors using a specific tool. The tool doesn't have official support for MacOS but I've ...
1
vote
0
answers
25
views
How do I delete all folders with a similar name that do not contain large files on linux commandline?
On my linux server for my media library I used a function to change show season names to have a leading zero when needed, so "Season 1" would be Season 01" and so on. The problem is ...
3
votes
1
answer
312
views
Is there a Windows equivalent of Linux `.desktop` file to execute various commands (like as many custom "apps")
I am using Windows in parallel with Linux again, and I've got all the Linux habits and reflexes, without which I feel very frustrated.
For example, how to create a file to launch a terminal with a ...
0
votes
0
answers
63
views
column -x: how to specify the number of columns?
For column -x, how to specify the number of columns (say, 4)?
Is it possible at all?
Extra: from man column:
-x, --fillrows
Fill rows before filling columns.
0
votes
0
answers
48
views
One liner command to ssh to server2, switch to another user in server2, ssh into server3, run commands in server3 and get output
Because I can only get to server3 from server2 (Server2 running CentOS7), I'm trying to create a "template" command or a script that I can use to :
ssh to server2
switch to another user in ...
1
vote
0
answers
56
views
How to detox filenames in a bash script with no errors posted?
OS: Kubuntu 22.04.4 LTS x86_64
detox 1.4.5
To display above:
neofetch --stdout |grep 'OS:'
detox -V
Here is a toxic filename, starts with s1:
s1 Ä Ö Ü - ä ö ü Science & < > " 1 \ 2 ⁄ 3 ...
0
votes
0
answers
82
views
How to launch another blank terminal in Kali Linux?
When I launch another terminal in Kali Linux with Cmd+Shift+T, I can see Shell No. 2 tab created.
However, it is just a copy of Shell No. 1 and all the commands I ran on Shell No. 1 are visible on ...
10
votes
4
answers
2k
views
Why does assigning a variable with command substitution, and then echoing that variable, always fail?
Why does the following not work in Bash?
# Ensure TEST is unset
export TEST=''
echo "Hello world!" > test.txt && TEST="$(cat test.txt)" echo "$TEST"
It always ...
1
vote
1
answer
97
views
Keep command line visible while scrolling
Unsure what the best place to tackle this would be .bashrc? Using different shell? Some fancy terminal emulator?
Basically, I just want to keep seeing the command line / the last line of the terminal ...
0
votes
2
answers
226
views
Remove all files with name starting with single quote
I need to delete all files with these names (the quotes are part of the name):
'index.html?some-query-string'
I tried with:
rm \'index.html?*\'
I get this error:
rm: cannot remove ''\''index.html?*'...
0
votes
1
answer
34
views
linux command line, rearrange djvu file to facilitate book index use in reader
To read books that have an index on my laptop or ereader, I like to make the first page in the reader/viewer be the first page of the text, so that the book's Index page numbers correspond directly ...
0
votes
1
answer
58
views
How to simply cleanup a filename?
OS: Kubuntu 22.04.4 LTS x86_64
to display above:
neofetch --stdout |grep 'OS:'
.
How to simply cleanup a filename, not file contents?
by removing from a filename:
\n newlines
\t tabs
non printable ...
0
votes
1
answer
37
views
How to use ffmpeg speedup video specific time range in one line ffmpeg cli
I try following splited cli, they work well
ffmpeg -i "$input_file" -filter_complex "[0:v]trim=start=0:end=10,setpts=PTS/10[v1];[0:a]atrim=start=0:end=10,asetpts=PTS/10[a1]" -map &...
0
votes
2
answers
46
views
An incorrect path is displayed in my custom command line prompt in bash
I would like to display the current and parent directories in my Linux command prompt. For example, if the current directory is /home/user/proj/src, I'd like the prompt to display proj/src.
I found ...
0
votes
0
answers
51
views
Why can I get a ftp file by navigation, but not through full path?
I an trying to download a file from an ftp server that is in a sub-subfolder. I could find in the expected place with FileZilla but my program (trying to download using the full path) gave an error ...
2
votes
1
answer
51
views
How can I use the last changed file as an argument in linux?
I'm thinking of using the last changed file as an argument to commands like ls, echo, or cat, is there a simple and efficient way? this question arose when I was faced with analyzing the latest log ...
1
vote
1
answer
130
views
Disable auto-complete Linux
How do I prevent multiple inputs from occurring when holding down a key?
If I hold down a key like an arrow key it will repeat the key event rapidly. To prevent this I have tried
xset -r 103 r off
...
0
votes
1
answer
71
views
How to bring a job to foreground and then disable job control in bash?
I have a program running in a terminal window. I wish to disable the Ctrl+Z shortcut from suspending the process.
After pressing Ctrl+Z, the command fg && set +m unfortunately disables job ...
0
votes
0
answers
84
views
Open new Google Chrome tab in a named window
I'm on Linux and I use scripts to open webpages. I also group my tabs into named Chrome windows, i.e. --window-name="Group 1".
How can I open a new tab in a specifically named window? ...
0
votes
2
answers
1k
views
How to safely store environmental variables and make it actually invisible in my PC?
I am learning about environmental variables. I know for example that if I have a secret password I should not code it inside of my code.
From what I understood is that a .env file should be used to ...
0
votes
0
answers
218
views
Failed to enable unit: Invalid argument systemctl enable .service
I have made a startup_test.sh with the following contents
cd /home/xyz/Desktop/
gnome-terminal -e "bash -c ./efg"
#desktop folder contains an executable named efg.
If I run gnome-terminal -...
1
vote
2
answers
168
views
Why does zip --exclude only exclude files in the folder but not the folder itself?
I have the following command run in the bash shell which excludes the files in the folder scripts/. I tried the answer in Zip command for excluding directories and files but unfortunately it did not ...
0
votes
1
answer
118
views
How to grep on mysql CLI command output?
mysql> SHOW SLAVE STATUS\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for source to send event
Master_Host: xx.xx.xx.xx
...
0
votes
1
answer
77
views
remove duplicate character from string in pure bash - works in CLI but does not work in script
I want to remove all duplicate minuses from a string using pure bash (no sed/awk/etc). This works great in CLI:
s="com---strig-3-1080p-----mp4"
echo "${s//+(-)/-}"
com-strig-3-...
0
votes
1
answer
356
views
How to invert an SVG image?
I’m searching for a solution (in Linux console) which “inverts” an SVG. It shall take an input .svg and generate output .svg with multiple shapes, each one filling a single transparent area. And vice ...
1
vote
0
answers
57
views
How to command pv (Pipe Viewer) to work with diff?
using:
OS: Kubuntu 22.04.3 LTS x86_64
diff (GNU diffutils) 3.8 Copyright (C) 2021 Free Software Foundation, Inc.
pv 1.8.0 Copyright 2023 Andrew Wood, pv = Pipe Viewer
commands to display above:
...
0
votes
0
answers
27
views
switching window keyboard shortcut with screen window management on MacOS
all
I used to be a linux user, now I am accessing a server from MacOS, Ventura. I have remapped my Mac Keyboard by switching the ctrol and command keys. However, I came across some problems with the ...
1
vote
1
answer
188
views
Searching for a string in a specified file extension with conditions
I'm currently grepping a directory looking for a specific string that is only present in .txt files. However, I'd like to expand my grep to only return values where the directory contains specific ...
0
votes
2
answers
421
views
Find and delete files with linux command line
I want to delete all files containing "chrome".
I have this command on linux :
find . -type f -name '' -print -delete
after name I don't know what to put.
I tried *chrome* or *chrome*.*...
0
votes
1
answer
478
views
How to find cpu spike for the past 2 days?
I was trying to find the linux command to show the cpu spike for the past 2 days.
I was able to get the CPU% with sar command sar -f /var/log/sa/sa$(date +%d -d "2 days ago") but it is not ...
0
votes
1
answer
39
views
pipefail over ssh in linux
set -o pipefail is not getting evaluated correctly on the remote host if the set command is used in ssh command.
Example
ssh hostname "set -o pipefail; false | true; echo $?" - gives 0 (Not ...
2
votes
0
answers
38
views
Is this a good way for knowing if the code has changed after submission to a customer?
I'm looking for a way to see if any files have changed once I submit code to a customer. Usually, I'd check the hash on a git commit or gpg sign a .zip file. I'm looking for a way to do this "in ...
0
votes
0
answers
61
views
Zipping a folder and sub-directories not working without sudo?
I wrote a python script using Amazon's AWS Boto3 SDK to download files from an S3 bucket and puts them in a folder (in a directory within my home dir). For reference, the function I used was the s3 ...
2
votes
1
answer
932
views
Command Line decryption of aes-256-gcm no-longer working after OpenSSL updated
Late last year (2022) I encrypted a file using OpenSSL using terminal on my Mac with a very simple openssl enc command and was able to decrypt using this command:
openssl enc -d -aes-256-gcm -in ...
0
votes
1
answer
99
views
Output of atool -l for large archives
The command atool -l my_archive prints the directory structure and files of my_archive to the command line. This is very handy if the archive contains only a few files. However, if there are many ...
0
votes
0
answers
62
views
How to export a text file from SQLite3 with CLI Kubuntu
Unsure if it is even possible to get a human friendly text file from this SQLite3 file with CLI (Command Line Interface) Terminal with Kubuntu.
using:
neofetch --stdout |grep 'OS:'
OS: Kubuntu 22.04....
0
votes
0
answers
48
views
Remap Super+w to up key
I am using Linux mint 21.2 . My laptop up arrow is not working. Please guide to set(remap) Super+w as up key. I want to use it system wide specially with bash.
I have tried the following script by ...
0
votes
1
answer
82
views
What command to force dd output to a fixed width of 90 characters?
using:
neofetch --stdout |grep 'OS:'
OS: Kubuntu 22.04.3 LTS x86_64
dd --version
dd (coreutils) 8.32
Background:
re-purpose a disk = objective
some script is being developed
some script will delete ...