Questions tagged [command]
One or a set of directives issued in the *nix environment to get information, change the state of something or to execute something. In other words: To gain an objective.
1,066 questions
1
vote
1
answer
46
views
Cancel just second command of bash logical AND operator [duplicate]
It often happens that I have some long task running, like compiling a program, running tests or copying large archives. Once I am done with whatever else I was doing, I want to leave the computer ...
0
votes
0
answers
68
views
Arch Linux - rsync succeeds but prsync does not work
I am moving a large number of files from one PC to another. The two PCs are in 192.168.0.0/24. I started by ryncing all music I had on my source PC to my new PC.
> rsync -P --recursive 192.168.0....
2
votes
1
answer
253
views
Unix or Linux command to compare binary files [duplicate]
I'm looking for a command that compares binary files.
Of course, I know about diff, but it is not very good at binaries.
I have two files from a error-prone source (scratched dvd) which should be ...
0
votes
1
answer
135
views
Is there an official (re)source where is list it all the categories of commands with their respective set of commands?
Just being curious:
Question
Is there an official (re)source where is list it all the categories of commands with their respective set of commands?
Something like Linux Foundation for Filesystem ...
0
votes
2
answers
177
views
Kill current bash shell and start a new one with some command
is it possible to kill/exit the current bash shell and start a new one with some command?
Something like
kill -9 $PPID && bash -c echo 'I started new!'
which does not work obviously.
1
vote
3
answers
208
views
How to find the python command in a shell script?
Let's suppose that you have a super python 2&3 one-liner that you need to use in a shell script.
On system A the python command works, but on system B you have to use python3, on system C you need ...
0
votes
1
answer
116
views
cpulimit: detect failure / exit status in Linux
I'm using cpulimit in a Bash script to run a certain command (ffmpeg) with a limited CPU usage, but I want to know if the command fails. But when the command(ffmpeg) fails with any error, cpulimit ...
0
votes
1
answer
196
views
Understanding the concepts of commands, processes and namespaces
I am not a strong linux user, but I want to better understand the material in this post here which talks about linux namespaces
https://stackoverflow.com/questions/44666700/unshare-pid-bin-bash-fork-...
0
votes
2
answers
190
views
Command to know the speed between mainboard and HDD/SSD
I want to know the speed of data transfer between a HDD or SSD and the
mainboard. It through a command. If is possible through a GUI, it is accepted too
Goal:
I want to do a comparison of speeds ...
0
votes
4
answers
123
views
editing files in batches from a huge amount of data
I ran into an issue:
I have folders with usually 50-150 text files, which I need to modify.
sed is not an option, since the changes cannot be automated
(sometimes "ss" need to be changed, ...
2
votes
1
answer
232
views
What is the output of "date -u +%V$(uname)|sha224sum|sed 's/\W//g'"
I am trying to register on the arch linux forum and am asked for the output of this command:
date -u +%V$(uname)|sha224sum|sed 's/\W//g'
Why am I being asked this and is it safe to run? I am unable ...
0
votes
0
answers
32
views
What does alt + PrtSc+ REISB do? [duplicate]
I remember hearing this as a safe way to reboot a frozen system but never looked into what it actually does. What does this command do?
0
votes
1
answer
307
views
Setting Maximum Packet Size up to which GRO can combine in the Linux Kernel
In a Linux environment, Generic Receive Offload (GRO) helps improve network performance by merging multiple packets into a larger one, reducing CPU overhead.
Now we want to control the maximum size of ...
3
votes
1
answer
648
views
Are ethers, rarp, plipconfig and slattach commands deprecated and what are their replacements?
There are 10 networking tools in net-tools Debian package (and also other distros, probably the package is named differently):
arp (ip n)
ifconfig (ip)
mmi-tool (ethtool)
nameif (ip link)
netstat (ss)...
-1
votes
1
answer
232
views
What happens if sudo rm -rf /* is done in WSL?
NOTE: DO NOT USE THIS COMMAND UNLESS YOU KNOW WHAT YOU'RE DOING
From what I've find on the internet, the sudo rm -rf /* command wipes out everything in the linux system. If this command is run on WSL, ...
0
votes
1
answer
357
views
How to determine from the lspci output how cards and how many ports are on a card?
I need to write a script to count how many 2 or 4 port HBA cards we have in each of our servers.
I'm running lspci on each of the servers, however, none of the documents I've read so far is telling me ...
1
vote
3
answers
2k
views
Linux command vs bash command, is my understanding correct?
this question may be a bit terminological.
As a new Linux learner, I find many tutorials mention Linux/bash commands. To my understanding, commands are just various programs and bash is a shell like ...
0
votes
1
answer
225
views
How does "Useless cat. ... or 'cmd file | ..' instead." should be applied?
I have the following line:
isUbuntu=$(cat /etc/os-release | grep '^ID=ubuntu$' | wc -l)
It works fine
Now, through VSC and mostly with the ShellCheck extension is indicated two warnings messages as ...
0
votes
2
answers
357
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 ...
0
votes
1
answer
201
views
sync command run as standard user
There are several blogs online saying if sync is run as sudo this will sync all filesystems, but if it's run normally (no sudo) then it will sync "current" filesystem.
But it's not clear ...
0
votes
0
answers
51
views
execute a script on different remote machines on multiple files
I want to execute a script which is located on different machines. On each machine there is a set of files which the script should scan. I have something like this but it does not work:
for host in ...
0
votes
1
answer
136
views
Get a list of all user's commands from a non-interactive shell
I am writing a script that would automatically suggest some new aliases/functions to be added to a user's shell config. Before doing that, however, I would like to make sure the aliases being ...
1
vote
0
answers
54
views
Why some system cmds would be designed (compiled) as shared object type file? [duplicate]
For similarly, the following system cmds all are the same executable files.
So why some system cmds would be designed as shared object type file ?
#
#
# file /usr/bin/passwd
/usr/bin/passwd: setuid ...
0
votes
1
answer
200
views
du -h only show folders but not files, how to show all?
I don't know what's going on with my centos 7 machine but seems like du -h /path only shows folders, not files, and it's annoying. I want to find all the files and folders at a specific depth and sort ...
0
votes
2
answers
65
views
How do I get bash to use a specific directory when running a command?
I have a problem with the handling of the mysql command.
When I try to use mysql -uroot -p, I get an error:
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
However, when I ...
1
vote
0
answers
170
views
How to work with CPU and memory intensive application in Linux?
This is the scenario,- it is a Java Application mainly, Heap Dump & Thread Dump is not helping me. Maybe I am not wise analyzing it.
Observation 1) Lots of memory seems to be utilized.
[maddipp1@...
3
votes
3
answers
296
views
How does the d option for the ls command exactly work? [duplicate]
Having the following simple structure:
project
main
aaa
aaa
test
ddd
ddd
pom.xml <--- unique regular file
If the current directory is project and if is executed the ls command ...
0
votes
1
answer
2k
views
Open terminal in directory open in file explorer
In GNOME, I wish to setup a shortcut to open terminal in presently viewing directory in the gui file explorer. The nautilus gui is opened from terminal by the command xdg-open ., but I'm not sure if I ...
0
votes
2
answers
321
views
Remove invalid characters from recursive Linux filesystem
I have a huge filesystem full of folders/files using invalid characters.
I have found one command that almost does what I want and it came from this thread - https://stackoverflow.com/questions/...
0
votes
2
answers
255
views
Counting Files in Remote location using sftp in shell script
Getting Error with the below command to check on the Remote directory a specific type of files. The requirement is to get the count of the specific files.
file_exists=$(sftp $FTP_UNAME@$FTP_HOST ls *$...
0
votes
0
answers
81
views
How to gracefully handle differences in command options between different versions?
Inspired by What is the difference between “base64 -b0” in macOS versions prior to macOS 13 (Ventura) and “base64 -i” in macOS 13 (Ventura)?
Are there common ways to avoid the script breaking on a ...
-2
votes
1
answer
120
views
CSV file with many columns, print each using loop [closed]
I have a CSV file saved on my desktop with many columns.
The CSV file has only one row but 195 columns and I have to print each column in Unix using loop command. The path of the file is /home/...
0
votes
1
answer
173
views
On simple filenames as commands versus arguments
I am reading Sobell's A Practical Guide to Linux Commands, Editors, and Shell Programming, 4e, and I am currently starting Chapter 5 on the basics of shells.
On page 135 Sobell explains that
From the ...
0
votes
1
answer
138
views
In Fedora how to launch a webapp from the terminal?
I have installed a webapp (Copilot) using edge in Fedora.
I would like to launch the app using a shortcut but I cannot find the command to launch it.
I imagine it should be a command launching the ...
0
votes
0
answers
797
views
Deleting a hidden file with linux command
I tried using rm -rf .* command to remove a hidden file and I am met with this error.
rm: refusing to remove '.' or '..' directory: skipping '.'
rm: refusing to remove '.' or '..' directory: skipping '...
-1
votes
1
answer
166
views
Checking if I'm correct about the order of operations in Bash
Guten Tag! I'm a rookie in everything Bash-related. I'm familiarizing with the syntax and wanted to know if the order of operations in this command is as I thought or not.
The command:
echo 2 * 3 > ...
1
vote
1
answer
142
views
Quote characters work as commands that redirect to the standard input
I am a student and I am trying an excercise that involves assigning a word with quotes, double quotes and other symbols to a file name.
The problem is that I am not getting the expected results.
I am ...
0
votes
1
answer
78
views
Find file in directories of PATH env which match partially
Idea is to match a filename in any of directories mentioned in PATH environment. Usually, we do this by running "which <executable_filename>".
This works fine, when the file your are ...
-1
votes
2
answers
7k
views
How does the `tr` command work?
I was playing around with tr and got some unexpected results. What is happening in these situations? I don't understand what is happening under the hood, or perhaps I'm not using this command ...
-1
votes
1
answer
73
views
Strange behaviour of type command
I sometimes use the type command to view my codes:
$ type squared
squared is a function
squared ()
{
local t=$(($1*$1));
echo $t
}
I can do the same with builtin functions:
$ type ...
-4
votes
2
answers
158
views
Command like head except instead of showing output by new line, shows output by space
head example:
Desktop:
λ df -h
Filesystem Size Used Avail Capacity iused ifree %iused Mounted on
/dev/disk1s7s1 113Gi 8.9Gi 8.6Gi 51% 355384 90345720 0% /
/dev/disk1s2 ...
1
vote
2
answers
4k
views
sticky bit on files and directories
I've always heard that sticky bit should be only used with directories, and I understand that, but what is the meaning if it is applied to a file. If I set the sticky bit to a file and do an ls -la I ...
0
votes
0
answers
26
views
What does "set -- command doas $@" do in my Bash function? [duplicate]
I use this Bash oneliner, set -o errexit;set -o pipefail;set -o nounset;doas() { [[ "${EUID}" == '0' ]]||set -- command doas "${@}";"${@}";} in the head of my scripts in ...
-1
votes
1
answer
157
views
how can i use 'memusage' command on Centos 7?
When I input memusage command to my terminal on Centos7, it will show bash:memusage: command is not find.
How can I use this command?
1
vote
2
answers
562
views
find exec - use only partial filename from {}
I have following directory structure:
├── file1.json
├── file2.json
└── file3.json
I want to remove the .json suffix. I know the best way would probably be the rename command or to use a for-loop, ...
-1
votes
1
answer
254
views
COMMAND=list in /var/log/auth.log... does list refer to the ls command?
Basically the title. I've been looking through the authentication logs of a compromised virtual machine (it's just a simulation), and I noticed that after the system accepted the hacker's password, ...
2
votes
1
answer
222
views
Replacing a character in all files names of a directory
This is homework!
I'm trying to replace all spaces in file names with an underscore in the yay directory. It asks me to use the commands xargs and sh without using $(command). I tried using conducts ...
0
votes
0
answers
167
views
Bash reverse search inserting characters into command after hitting tab
SYSTEM:
Ubuntu: 20.04
Kernel: 5.4.0-162-generic
bash: 5.0.17(1)
I found a strange problem that when I use bash's reverse search with CTRL+r, I will find a command I want to run. I select TAB to ...
-5
votes
1
answer
486
views
With what command is possible know the RAM's DDR type, Speed and Frequency by each slot? [duplicate]
For a computer, such as laptop or server used for developing and server purposes respectively and taking in consideration that can't be opened.
With what command is possible know the following specs ...
3
votes
1
answer
780
views
With what command is possible know the mainboard requirements about the RAM?
For a computer and/or laptop used for developing and as server purposes, of course, it according with the hardware itself.
Question
With what command is possible know the mainboard requirements about ...