Questions tagged [command-line]
The command-line is the interactive interface to your shell.
6,245
questions
0
votes
1
answer
44
views
Opening .xlsx file in linux terminal
I work in a cluster. I would like to ask if it is possible to open .xlsx files in text editors like nano or vim.
Is there any possible way if I have not Microsoft Excel (or any relevant application in ...
0
votes
1
answer
40
views
Command-line option to disable too many processes in htop
By default, htop shows many more processes than other tools (top, ps). The solution is to press H, as mentionned in Why are there many processes listed under the same title in htop?, to get the "...
1
vote
0
answers
35
views
Going to the direcory of a file as fast as posible [duplicate]
Is there a way to get to the path of a file as fast as possible and in the least amount of keystrokes.
Context:
Type cd and then paste the path of a file and then have to go back and hit backspace ...
0
votes
1
answer
44
views
Looking to add or append terms in multiple lines using sed command
On our intranet server, we have a control record with almost a hundred lines, with each line corresponding to a program. Each line has the usernames afterwards of each user that can access and use ...
23
votes
2
answers
5k
views
High CPU usage by process with obfuscated name on Linux server – Potential attack?
We have been experiencing high load issues on our Linux server recently. Upon checking with the
top
command, we noticed an unknown process with a garbled command name (as shown in following images; ...
0
votes
0
answers
25
views
how to use `vi`/`vim` in cli mode like `sed` [duplicate]
i need to replace some strings and due to some reason, vi or vim is my only options.
but the problem is i need this to be done in a shell script, is it possible to use vi/vim in cli mode like sed?
e.g....
0
votes
1
answer
37
views
Could linux give clearer error messages to distinguish files from directories?
mkdir temp
mkdir: cannot create directory ‘temp’: File exists
rm temp/
rm: cannot remove 'temp/': Is a directory
Is there any reason why the first error message should not be "Directory exists&...
0
votes
1
answer
32
views
How to launch a GUI-application from terminal while keeping the terminal on the front and the cursor on terminal
Let's say I want to launch an application from the terminal but I want to keeping the terminal on the front and the cursor on terminal
e.g.
$ mupdf somepdffile.pdf
Is there a way to do it?
-2
votes
1
answer
55
views
Trying to mount a drive, but Mint can't find it?
I'm trying to mount the NTFS partition as described here https://linuxconfig.org/how-to-mount-partition-with-ntfs-file-system-and-read-write-access
The system is installed on sda5 and mounting sda1 is ...
0
votes
1
answer
71
views
"_split_longopt: command not found" when trying tab-completion
For the past couple of weeks or so, I've noticed that, often, when I press the Tab key to try and complete a command in a bash shell in a terminal, I get an error message. It says:
bash: ...
-1
votes
1
answer
47
views
pkexec vs runuser
pkexec is not installed by default on Debian unlike runuser which is.
So far I've been using pkexec but discovered there is also runuser, and since runuser seems to be more advanced (looking at ...
3
votes
2
answers
526
views
How to limit the number of files printed by ls and print them in columns like ls prints normally?
Here is extension of the question: How do I limit the number of files printed by ls?
with additional condition: how to print results in as many columns as fit to the current terminal width — as ls ...
0
votes
0
answers
60
views
Why is `mv -f source target` so much slower than `rm -f target && mv source target`
I got a case where I need to overwrite some file with another and noticed a very significant slowdown when using "mv -f" if the target already exists and is being read. More specifically, ...
0
votes
1
answer
42
views
Is the idea of having a login shell and a non-login shell merely a way of making user preferences? [duplicate]
Scouring the internet about the difference between a login shell and a non-login shell, it turns out that the ultimate difference is merely the files that are being sourced. A login shell sources some ...
1
vote
3
answers
58
views
Bulk Resize Images of Different Aspect Ratio so that all have Same Width
I am trying to resize multiple images inside of a folder so that all images have the same width, keeping aspect ratio. The images are all different sizes and aspect ratios. I don't care about the ...
8
votes
3
answers
712
views
Is there an equivalent of caniuse for commands on posix systems?
I'm thinking about using a callout to the jq command in a utility script I'm writing, rather than parsing JSON manually.
In order to make the script as portable as possible, I want to know which ...
0
votes
3
answers
47
views
Play sound after command and also pipe output
I can easily pipe the output of a command like:
some_command | less
I can also easily play a sound after a command like:
echo test; print \\a
aplay, beep or others could also be used for sound.
...
1
vote
1
answer
96
views
Bash completion after quotation mark
I am experimenting with bash completion to write a general completion library in C associated with command line parsing and stumbled in a behavior for which I can find no documentation.
I am using the ...
-2
votes
1
answer
37
views
Is there a port of the Windows' REN command for Unix-like operating systems? [duplicate]
I already know the rename command in GNU/Linux. However, it is very complicated and cumbersome because it uses regular expressions.
For example, in Windows, I can simply rename files in bulk by typing:...
4
votes
4
answers
1k
views
How can one count how many pixels a GIF image has via command line?
I use Ubuntu. I have a large number of GIF images. How can one count how many pixels a GIF image has via command line?
-4
votes
1
answer
89
views
Find actual file by only file name, not literally everything non-related
PuTTY/SSH and logged in as root I simply want to find any instances of the file PEAR.php.
I've looked through a dozen different tutorials but they seem to just copy-paste the same instructions. An ...
0
votes
4
answers
220
views
command-line tool to sum the values in a column of a CSV file
I am looking for a command-line tool to calculate the sum of the values in a specified column of a CSV file. (Update: The CSV file might have quoted fields, so a simple solution just to break on a ...
0
votes
1
answer
82
views
Is there any sort of command-line tool I can use to detect and write metadata for a song's key?
I would like to get into DJing, or at least putting songs together in series and making it work. I have already used bpmwrap to tag the tempo for every song in my library, and it immediately made me ...
0
votes
1
answer
56
views
rpm -qa but filtering for partial package name match?
I'm learning about the rpm package manager command. I figured out how to use rpm -qa however the list exceeds the overflow of the SSH program so I can't see the entire list.
How do I use the rpm ...
0
votes
1
answer
52
views
open vpn - not working but also dont returns any error
i have both open vpn server and client. the client is my windows pc and the server is a ubuntu 22 VPS.
im running openvpn on the serverside with this command :
openvpn --dev tun --ifconfig 172.16.0.1 ...
1
vote
0
answers
57
views
Shell: Customizing the "Display all N possibilities? (y or n)" message
I already know that double-pressing the Tab key on Bash terminal will enlist all files and folders in the current working directory or, when appropriate, show Linux executables that I can run. I want ...
-1
votes
2
answers
108
views
How to print out all printable ASCII strings contained in binary data?
How can I print out all printable ASCII strings
(e.g., longer than four chars) contained in a binary file?
0
votes
2
answers
91
views
command suggestions while typing for beginners
When typing the commands in any shell, can there be any kind of setting that can be enabled for beginners to type just an alphabet and it will suggest multiple commands that the beginner might be ...
1
vote
1
answer
121
views
Shell script to run command and show output in notification box
I have command line utility that generates text strings, by running a command within the directory:
./Utility -P
it prints output on terminal. How to make a shell script showing the generated string ...
-6
votes
1
answer
77
views
Finding difference between two Linux Commands
How to find the difference between rm and rmdir commands in Linux Bash Shell?
-1
votes
1
answer
99
views
How can I solve this error in wifislax 4.9
I can't understand why the commands not work please help me
12
votes
2
answers
4k
views
Check if current user can run sudo without requiring a password
I want to check if the current user running a BASH shell script has access to passwordless sudo or not. If they don't, I'd rather have the script exit rather than prompting them for a password.
1
vote
1
answer
32
views
Passing modprobe options through environment
man modprobe says in the ENVIRONMENT section:
The MODPROBE_OPTIONS environment variable can also be used to pass
arguments to modprobe.
But this is unclear. Suppose for example that I want to force ...
0
votes
0
answers
117
views
Bash terminal lagging one input behind
After a recent update, I've noticed that working on any terminal for more than a few minutes causes a delay between inputting a keypress and seeing it reflected on the screen.
Specifically, if I were ...
0
votes
1
answer
91
views
How to delete a directory whose name has special characters
My ./imap directory contains two folders with names containing special characters :
‘No’$‘\351’‘.sbd’
‘S’$‘\351’‘gol’$‘\350’‘ne.sbd’
(these are the full names with no other characters added).
The ...
0
votes
1
answer
41
views
getopt with several `--`
I have a script with this usage:
myscript [options] positional-args... -- [fwd-params]
Because [options] can have long, or short variants, I like using getopt. But I'm having troubles.
I use getopt ...
1
vote
1
answer
65
views
Using cryptsetup and mount without sudo
I'm trying to build a CLI to easily manage the backups I have on my hard drives. Currently I use LUKS to encrypt the drives and duplicity to manage the backup process, and I have a simple bash script ...
1
vote
4
answers
109
views
Zip all files in directory to multiple independent outputs
I am trying to zip all files in a single directory into multiple independent output zip files. What I mean by this is that I do not want to produce a split archive; rather I would like multiple zip ...
10
votes
3
answers
2k
views
GNU sort command does not sort words of different lengths with common prefixes correctly when using field delimiter
The GNU sort command is not sorting words of different lengths with common prefixes correctly for me, but only when using a field delimiter to sort on one of multiple fields.
Here is the correct, ...
0
votes
0
answers
30
views
apt cache for live build
How can I cache all internet files when building with live-build? lb config --cache true --cache-packages true --cache-indices true does not work (see the last section of the build script and log).
...
0
votes
0
answers
28
views
Difference in live usb and base
I have booted into the official Debian live USB with debian-live-12.5.0-amd64-gnome.iso. I have changed a few settings (for example, enable touchpad's tap-to-click in system settings and Firefox's ...
4
votes
1
answer
84
views
Monolingual french offline commandline dictionary?
As the title says, I'm looking for a monolingual french dictionary that I can query on the commandline, ideally offline. For example to have a low latency way to check the gender of nouns.
I looked at ...
0
votes
1
answer
148
views
How to use grep string that has double quotes in it
So I'm running a simple alias called vpn which runs a command and has an output, which I put into a .txt file.
If interested to what exactly then here is the alias
alias vpn="docker exec -it ...
0
votes
2
answers
131
views
How can I compute bcrypt hash with less than 16 (2^4) rounds on Linux?
How can I compute bcrypt hash with less than 16 rounds (cost factor of 4 = 2^4 = 16 rounds) on Linux?
This is the same question as Compute bcrypt hash from command line, but requiring a cost factor of ...
1
vote
1
answer
37
views
Retrieve large number of files from remote server with wildcards
I'm trying to download a large number of files from a remote server. Part of the path is known, but there's a folder name that's randomly generated, so I think I have to use wildcards. The path is ...
-1
votes
2
answers
101
views
Recursively search for txt files that has all the search strings
I want to find all the files that has the words
“Who”, “What”, “Why”, “How”, “When”. All of the words, in any order. Case Insensitive
I tried:
grep -rl --include='*.adoc' "Who" . | xargs ...
3
votes
1
answer
204
views
udisksctl: get loop device and mount point without resorting to parsing localized output?
udisksctl is my tool of choice when dealing with file system images (recent example, but I've been doing this all over the place).
The dance typically looks like
fallocate -l ${img_size} filesystem....
1
vote
1
answer
124
views
List openvswitch virtual switch with ip command
I've configured openvswitch virtual switch and can list it with ip command as follows:
# Show all interfaces
ip link
Output:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN ...
2
votes
2
answers
119
views
Create FAT-formatted disk image that can fit 1G file
I'm struggling to create a FAT-formatted a disk image that can store a file of known size. In this case, a 1 GiB file.
For example:
# Create a file that's 1 GiB in size.
dd if=/dev/zero iflag=...
0
votes
1
answer
104
views
process ID of process launched with system command
Suppose I open a shell on ubuntu OS, then open a software such as matlab via
matlab &
In the matlab GUI, I do a system command
system('/path/to/my/cppprog') % <-- PID of this running program?
...