Stack Exchange Network

Stack Exchange network consists of 174 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
0answers
35 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
0answers
13 views

Sudo hangs to run software EastFDTD

As I want to run a program, I command it as below and then I fill in the password. Next it hangs, did not do anything. What I am suppose to do, reboot my pc and program or there are some tricks to ...
0
votes
1answer
49 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
53 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
votes
2answers
26 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
40 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
0answers
27 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
41 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
17 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
44 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
49 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
26 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
197 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
45 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
19 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
91 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
42 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
48 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
437 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
41 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
64 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
37 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
818 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 ...
5
votes
2answers
332 views

How do commands like fdisk -l find the sector size?

Does the MBR of the disk contain this information and therefore when i call a command like fdisk, a kernel level code eventually runs and reads it from a specific part in MBR? If so, which part of it? ...
0
votes
1answer
39 views

Can someone explain to me what this **diff** means..? [duplicate]

I'm having an extremely hard time to read this can someone explain what it means, and what the difference between the two is ? $> diff -U 3 user_output_test1 test1.output | cat -e --- ...
0
votes
2answers
64 views

Find the longest file name

I have to find the symbolic link which contains the longest folder name in a folder full of symbolic links. So far I have this: find <folder> -type l -printf "%l\n" I was wondering if there's ...
0
votes
1answer
212 views

history + display date and time for each command [duplicate]

we have redhat Linux machine version 7.2 when we type history we get the history but without date and time 1 ifconfig 2 cd /etc/udev/rules.d/ 3 ls 4 cat 99-vmware-scsi-udev.rules ...
0
votes
2answers
76 views

How to add multiple directories like the name 1-100 in one command

I need to create multiple directories using one command.  Is it possible? Like directory name starts from 1-100. mkdir 1..100
0
votes
0answers
20 views

How do I know if a device is still responsive?

An internal optical drive sometimes ceases to work on an external SATA adapter, connected via USB. If I connect it, it sometimes freezes forever (until powered off). What is a Linux command that ...
5
votes
5answers
2k views

How to copy files whose name contains number from 20 to 32

I want to copy files from the copyDest to pastDest that contain number from 20 to 32. What am I dong wrong? cp -r ~/copyDest/*2[0-9]|3[0-2]* ~/pasteDest Thanks.
1
vote
2answers
98 views

change the output format of a text file in unix [closed]

How can i change the output format of a text file in unix ? Need to use unix commands to work on these text files. Current output: (ABC.txt) Day Count 10 210 11 112 12 275 13 120 Day Count2 10 105 ...
0
votes
1answer
81 views

What differences between `type cd` and `which cd` commands in linux? [duplicate]

What differences between two below commands in CentOS7? $ type cd cd is a shell builtin and $ which cd cd is a shell builtin cd is /usr/bin/cd cd is /bin/cd The cd is a shell builtin command, but ...
1
vote
0answers
14 views

Automated logout of present session to refresh group commands?

So, I'm looking at automating a setup of service instances with AWS. AWS allows you to run shell scripts on instance creation. However! I've run into one little snag. I want, on initial ssh into the ...
0
votes
2answers
38 views

Pass Parameter to a redirected script in Linux

I have two scripts, suppose they are s1.sh and s2.sh. In s1, the code is step = 0 . .(omitted) . if [ $step -eq 19 ]; then ./s2.sh In s2, the code is step=0 . . (many codes here, but ...
2
votes
1answer
51 views

Get Unix to Tell Me The “x similar ones”

Often if I am doing something in the terminal I will mistype something and enter something unintended. If I type int as a trivial example, it tells me Command 'int' not found, but there are 18 ...
0
votes
1answer
60 views

Multiply column values by itself using awk

I would like to multiply column values by itself using awk. How can I do that? example 1 5 1 2 6 0 3 7 3 4 8 5 output 1X5X1 =5 1 5 1 5 X X X 2X6X0 =0 ===> 2 ...
-1
votes
1answer
20 views

How can I get a count of a Word called 'MSH' used multiple times in a file with a single UNIX command - AIX 6.1?

How can I get a count of a Word called MSH used multiple times in a file with a single UNIX command - AIX 6.1 ?
4
votes
4answers
796 views

How do I display file names that contain two characters and one of them is c?

I tried doing ls [a-z][a-z], but it doesn't seem to be working.
0
votes
1answer
49 views

how to rsync the directory structure and only one file within each folder between two servers?

I have gigantic data consisted of branching tree of folders, sub folders, sub-sub folders and sub-sub-sub folders. Inside the terminal sub folder, I have large number of images (~ 2000 image each file ...
0
votes
1answer
21 views

excluding sub dir in command

I need to provide a detailed list of files in a directory in descending order of the file size. only to include 10 files in my output. I can not include sub directories in my output. I am having the ...
1
vote
2answers
66 views

display permission for all files that start with -

I need to display the permissions details for all the files names in a directory that begin with just "_". I have tried various commands using ls and find and no joy.
1
vote
1answer
23 views

Link Command Question [duplicate]

I am looking for a simple command in GNU/Linux to count all files in a directory beginning with pa. I have already executed the command to show all the files beginning with pa which I used find /etc/...
0
votes
1answer
42 views

Finding and moving images without extensions between two directories [duplicate]

I have an old disorganized repository of files in a directory. I would like to move solely the images files to a new directory for archival purposes. The problem is that in this directory I have a ...
0
votes
2answers
46 views

conditional statement result directly in bash without using if

output the name of the file with more lines, and how many more it has (one space between the name and number). If there is a tie, the output should be "foobar 0". eg: foo has 1 more line: "foo 1"; bar ...
0
votes
2answers
34 views

Why different command scripts are used for the same command when run as a normal user and when run as a root user?

I see the script location for the command date for a normal user, it shows which date /bin/date But when I run the same command from root it shows the output /usr/bin/date. Why so ?
3
votes
3answers
754 views

Do all different Linux distributions have the same command lines? [closed]

Do all different Linux distributions have the same command lines? What I want to know is the same command line works for all kinds of Linux distributions (CentOS, Fedora, Ubuntu, etc.) or whether they ...
0
votes
1answer
63 views

SSH Client Closed on Command Error

I am using Debian or Windows with Putty to connect to a remote Debian machine via SSH. The remote machine (Debian) behaves differently from the other SSH servers I know so far. Whenever I run a ...
2
votes
3answers
983 views

type ls command [duplicate]

so i studied somewhere about the type command and came to know that type command can provide the location of command used with it,more specifically the location of the executable file associated with ...
4
votes
3answers
99 views

In what format does piped output get sent and received from one command/program to another? [duplicate]

When a command is piped to another command in what way or in what format does the piped output exist/get sent? Is it a temporary file? Is it a string? And how does the command that receives the piped ...
0
votes
1answer
127 views

Does a Linux command called (h) exist?

I read in an unofficial documentation about a Linux shell command called h: it was mentioned together with the help and man commands, without any explanation. So I tried it on my linux terminal but it ...