Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
28 views

Linux way to get Summation of elements on right

I have the following text stored in a .txt file - I want to have the sum of 'NUM_OF_USERS' using linux command. so the desired result here is - Total 236
0
votes
0answers
12 views

curl command - any option for site RDW and site SDB

I have an ftp command and i want to change it and use curl instead, but i am not able to find any options for site RDW and site SDB. Is there a solution? My ftp command is similar with: ftp ...
0
votes
7answers
74 views

How to delete the first word in each line of a file?

consider a file names 'file.txt'. It contains the following. dove is a bird tiger is an animal cricket is a game. Expected output: is a bird is an animal is a game.
1
vote
0answers
15 views

How do I enable listing of zsh commands as you type

on one of my machines while setting up zsh I seem to have accidentally enabled a pretty useful feature. when I search through command history it actually lists all the matching commands as I type. How ...
0
votes
0answers
26 views

How can I edit sudoers file if I have lost permissions despite providing root password?

While working on ubuntu, I have edited sudoers file and allowed myself to run only mkdir, cd command. Now I am unable to execute, install any command. Even visudo is not working despite providing root ...
2
votes
1answer
58 views

Run multiple commands after pipe

I am piping streamer ouput to mpv player which works fine. streamer -o - | mpv - But before starting mpv , I want to kill one program and then pipe to mpv. streamer program takes some time to ...
0
votes
1answer
26 views

How to copy the /bin files along with dependencies using commands?

The /bin folder of Ubuntu 14.04 has files with dependencies. I want to copy the symbolic links along with the files, into a separate directory. Is there an inbuilt command for this?
0
votes
1answer
70 views

When can a “cd” command fail in a shell script and what can I do to remedy it?

I have a shell script that failed to finish last week; it was a failed "cd" command and it exits if it fails. The script is a bash shell script for configuring new Debian installs. Here is the full ...
-1
votes
1answer
45 views

Bash: I have a variable in bash script; [duplicate]

I have a variable in bash script dirs= "4"; I want to get this number from another file so I am using a command dirs= sed -n '1p' < test.txt; It gets me the number, I see it in the terminal. But ...
0
votes
2answers
25 views

Show file and directory permissons from umask value

I have homeword about use umask value to make default file and directory permissons, but I got a problem in the following: If I have umask = 0541 0666 - 0541 = 0125, File permisson: ---x-w-r-x 0777 -...
0
votes
1answer
67 views

What is meaning of double hyphen (--) in ls command [duplicate]

I was looking for command to print only directory names in linux. I came across this novel syntax, where we can put two hyphens adjacent without any word. ls -ld -- */ What is the meaning of this ...
-2
votes
1answer
41 views

Conan: Command Not Found

I'm using a RPI 3B uname -a returns: 4.14.98-v7+ #1200 armv71 OS is stretch gcc version is 4.9.3 I'm attempting to setup my RPi to be a BLE gateway as per this project on hackster.io. I executed ...
0
votes
0answers
35 views

Which is the command who execute all file manager in Ubuntu or Debian?

I working in a custom bash command for open all files(*.*), the command who i make in bash is named "open". This is the content of my bash command file named "open": #!/bin/bash xmessage -center "...
0
votes
1answer
52 views

How can I see who and where is currently mounting at on my PC via nfs?

I thought the UNIX command showmount -a shows the current info of nfs: who is mounting on, and what directory of my computer it is attached at. But, when I use this command, it replies nothing like: ...
0
votes
2answers
27 views

How to combine two text formatting commands into one?

How does one combine two commands like the ones shown below into one command with one output file? first command: printf '%s\n' {001..500} input > output second command: sed 's/^/PREFIX /; s/$/ ...
0
votes
2answers
49 views

Add a sequential number in a particular line for multiple files

Can somebody tell me the command to add a sequential number to a particular line in a file and increment the same to other files. Ex: I have 5 files (messages) In line 5 of each message file, I ...
0
votes
1answer
21 views

Running command on each line of output immediately [duplicate]

I found out that when I run a command which executes a software that has continuous output lines e.g. traffic monitor like tcpdump or tshark the command keeps counting numbers on screen like 4, 8, 12 ....
3
votes
0answers
56 views

How little work could `/usr/bin/cd` or `/usr/bin/wait` do and still be conforming?

Can the executables with the same names as shell builtins get away with doing a lot less "work" than the shell builtins do? For instance, could the fg executable just exit abnormally immediately? ...
0
votes
1answer
27 views

How To Pre-Find A Command's Impact?

RPM & Yum could be helpful tool to find the new files that can be added after a pkg installation. But being a system admin in a world of ever-changing system files & data due to fast pace of ...
0
votes
2answers
98 views

What does the Unix login program/command do?

I am reading APUE and it keeps refering to the login program, but I still don't know what it is doing in my operating system (Ubuntu). §8.11: Normally, the real user ID is set by the login(1) ...
0
votes
0answers
17 views

Add locale in variable for command [duplicate]

I'm trying to call a command from a variable in a script with a specific locale, example : $ myYTDL="LANG=C.UTF-8 youtube-dl --get-filename" but each time I try and call it in the script, I get : $ ...
0
votes
0answers
26 views

What is the purpose of the -t (--truncate) option of ddrescue?

When specifying an output file without specifying a logfile, the output file will be truncated anyway. How exactly is using ddrescue -t /dev/devicename outfile functionally different from ordinarily ...
1
vote
0answers
38 views

How to modify blended video durations with a -filter_complex command argument in ffmpeg

Building off the solution provided in this thread, I'd like to know how to make simple modifications to a complex command argument which uses ffmpeg to interweave two videos by dissolving them into ...
0
votes
0answers
28 views

Command to change the port of the audio output device

Here is my machine: ,g$$$$$$$$$$$$$$$P. OS: Debian 9.8 stretch ,g$$P"" """Y$$.". Kernel: x86_64 Linux 4.19.0-0.bpo.2-amd64 ,$$P' `$$$. Uptime: 49m ',...
0
votes
2answers
30 views

How can I delete a particular file through the command line?

I'm using Ubuntu and would like to know if there is an easy way to delete a single file through the command line. In the same way you might use 'rmdir -r' to delete a whole file.
3
votes
2answers
46 views

How to wrap a command such that its execution is throttled (that is, it executes at most once every X minutes)

I'm interested in wrapping a command such that it only runs at most once every X duration; essentially, the same functionality as the lodash throttle function. I'd basically like to be able to run ...
2
votes
1answer
106 views

Command not found message [duplicate]

When running invalid commands without any parameters or options, in my experience we get only two kinds of messages which are exemplified below: ~$ Date No command 'Date' found, did you mean: ...
0
votes
0answers
37 views

How to run command recursively on files within directory and sub-directories within? [duplicate]

How can I run the command below recursively on all directories and sub-directories within? [someone@someones-pc ~]$ for i in *.mp4; do ffmpeg -i "$i" -i watermark.png -filter_complex "overlay=1623:25"...
0
votes
1answer
59 views

How can I add a password into a “sudo” command?

I want to use When Gnome Scheduler to run this: sudo service fancontrol start As "sudo" needs a password, how can I add it into the command, so that it can be run successfully? Each time Mint ...
0
votes
1answer
73 views

Why would calling cd (builtin) from cd (shell function) without “command” cause an endless loop?

I once read in a Bash book by O'Reilly the following (my summary): command and enable cd () { echo "Improved CD !" # Improvement one; command cd # Improvement two; # Do cool ...
1
vote
1answer
32 views

Is there any way to open the menu without using panel in Cinnamon?

Main Cinnamon menu is the default menu applet on Linux Mint Cinnamon, and as far as I understand it can't be run without the panel. Is there any command for opening the menu?
-1
votes
2answers
58 views

-bash: Setting: command not found - error when opening iterm [closed]

I keep receiving this error message each time I open a new tab in iterm: -bash: Setting: command not found Not sure how to fix this. I think it may have to do with .bashrc file that I recently ...
0
votes
1answer
46 views

mv: 'path1/path2/filename1' and '/home/user1/dir1/path1/path2/filename1' are the same file

After using command: find path1/ -iname 'file*[1234]' -exec mv -t /home/user1/dir1/path1/path2 {} \; I got an error that those files are the same. The command finished successfully. The parent ...
0
votes
2answers
59 views

Grep and run command in every folder where a file contained a match

I'm looking for an elegant way to execute a command in every folder where grep has found a match in a file. Much like find's -execdir flag, except that find only searches folder/file names, but not ...
0
votes
1answer
92 views

[1]+ Exit 125 nohup [closed]

I am running the following command: nohup ./run_hyper_param_tuning.sh> ../../logs/hyper_model_15_b_Jan.txt 2>&1 & echo $! >save_pid.txt It has been always working but suddenly it ...
0
votes
1answer
20 views

Is this a bug in fsarchiver --version

I learned that in order to capture the output of a Unix command one should use something like RESULT=$(command in question) I want to capture the version of fsarchiver to the variable RESULT because ...
0
votes
0answers
50 views

Print percentage (%) of files used by a command

I'm building docker images to be used in CI/CD pipelines by other developers. After the image build is complete, I run a few commands to do some test coverage. I'm curious if there's a Linux command ...
2
votes
1answer
68 views

pipe of tar and tree commands?

I would like to see the tree of a big compressed file (specifically only the second level of directories) so I used the following command: tar -tf tarfile | tree -L 2 But it outputs the tree of the ...
0
votes
1answer
27 views

Secondary password file creation and reset

Is there any way to reset all passwords previously created when the secondary password file is enabled for the first time to ensure higher-level protection ?.
1
vote
2answers
712 views

How to get value of a memory address using command?

At the memory address, 0x7fffffffeb58 of a program lies a value, I want to find out the value of the address. Is there a way to get the value just by using commands? I've tried dd but to no avail.
1
vote
1answer
49 views

program called twice from the command line [closed]

Let's say I have a (Python3) script of my own named myscript; for various reasons, myscript (not myscript.py) is stored in a sub-directory named bin : mydir/ mydir/bin/ mydir/bin/myscript -rwxr-...
0
votes
1answer
24 views

color of echo with commands

i have the following command: echo -n $i". "${!ip}" - " ;curl -X POST http://${!ip}:50333/api/v1/version; echo " " I want the output to be green so what i did was echo -n -e "\e[32m$i". "${!ip}" - "...
0
votes
2answers
177 views

Print SHA sums without “-” at the end?

Is it possible to have SHA sums print without the - appended to the end? $ echo test | sha1sum 4e1243bd22c66e76c2ba9eddc1f91394e57f9f83 - <--- this "-" dash/hyphen I know we can use awk and ...
0
votes
1answer
59 views

How do I create a new user and a new file in its directory?

I need to create a new user, and it needs to have a custom file named "config.sh". what I do when creating a new user is: sudo useradd –c "New User" –md /home/NU newuser –e 20/12/2018 –s /bin/bash –...
0
votes
2answers
73 views

Question about login logs using “sudo su - username”?

While doing my Linux training I found this curiosity: If I do "sudo su - username" and log into that username account, it doesn't count as login when I do "finger username" Take this image where "...
5
votes
4answers
456 views

How to treat a command output as text

I need to compare a command output with a string. This is the scenario: pvs_var=$(pvs | grep "sdb1") so pvs var is: /dev/sdb1 vg_name lvm2 a-- 100.00g 0 if [[ $($pvs_var | awk '{ print $2 }') = ...
0
votes
2answers
89 views

Can a shell script be a global command?

Check this page: https://www.veracrypt.fr/en/Uninstalling%20VeraCrypt.html As the documentation mentioned: ... To uninstall VeraCrypt on Linux, you have to run the following command as root: ...
-2
votes
1answer
69 views

Why can't I find anything on this command on the net? `statftime`

PROBLEM: I'm learning bash from books(Linux Shell Scripting with Bash, Ken O. Burch) and this book I'm following now is using this command: /usr/bin/statftime but I can't find this command for my ...
0
votes
3answers
40 views

How would I interpret this grep command which includes $path?

Concerning the command(s): path=$1 # ---> I am not entirely sure what this means either if grep -q -rHl --include \*.c --include \*.h "int main" $path So what I do understand is that it is ...
1
vote
1answer
3k views

-bash: python: command not found after install python3 on centos 6

when i finish install python3 , i can use python2, and python3 command ,but when i try python , it says command not found ,here is some output [root@localhost bin]# python2 Python 2.7.5 (default, Apr ...