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.

1
vote
2answers
48 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
38 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
13 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}" - "...
-14
votes
0answers
40 views

Linux homework questions [closed]

I need to: Write a shell script that receives two parameters (two filenames in a specific directory) and outputs whether those files exist. The script should handle if the arguments number is not 2 ...
0
votes
2answers
53 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
0answers
14 views

Search commands in Linux [duplicate]

We have a Capture the flag competition and we have to find flags. The flag contains the number "518" in the name. What are some linux commands to try and find these "flags"? There is also a command ...
0
votes
1answer
29 views

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

Introduction I need to create a new user, and it needs to have a custom file named "config.sh". Question So far what I do when creating a new user is: sudo useradd –c "New User" –md /home/NU ...
0
votes
2answers
29 views

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

Introduction Not so long ago I step upon this great endless voyage that it's Linux and UNIX systems learning. Question While doing my training I found this curiosity: If I do "sudo su - username" ...
5
votes
4answers
413 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
0answers
6 views

How do I test s4/hibernate multiple times without stop?

How do I test s4/hibernate multiple times without stop which is no need to login or give password as the platform reboot. I need it to continuosly hibernate about 10x without stop to test it for long ...
-2
votes
0answers
43 views

Command is not executed when executed as service

I need to execute a command as a service. I followed the following tutorial to it(https://medium.com/@benmorel/creating-a-linux-service-with-systemd-611b5c8b91d6). Following is my script. #!/bin/...
-2
votes
0answers
52 views

Mailx: command not found

I have a Linux server that is up and running for nearly 90+ days. [root@RHEL7 log]# uptime 06:23:31 up 95 days, 11:56, 10 users, load average: 0.30, 0.52, 0.56 [root@RHEL7 log]# uname -a Linux ...
0
votes
2answers
29 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
59 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
34 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
79 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
266 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
38 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
42 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
49 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
38 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
79 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
53 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
12 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
36 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
47 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
36 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
19 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
703 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
48 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
55 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
40 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
45 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
33 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
445 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
41 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
488 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
95 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
112 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 ...
0
votes
1answer
21 views

How can I create a quick access command in the terminal for an application

I want to create a quick shorcut to a file wich is: file.py it is located in "/myfiles/folder1/file.py" I want to access just typing in the the terminal: "file" this file has a working directory so ...
0
votes
1answer
39 views

running command with the “default” environment

This question https://superuser.com/questions/319043/runing-a-command-without-inheriting-parents-environment suggests that we can run a command without inheriting parent's environment by $ sudo -u "`...
-2
votes
1answer
40 views

combining options in find command from a letter to another

Find all the files in /etc that have .config and starts with letter a to the files that starts with letter k, that's means all the files from a to k in /etc .config.
1
vote
1answer
47 views

Why does my script not take command arguments?

I have a script: #!/bin/sh function usage() { cat << EOF >&2 Usage: $0 [-h] [-rs <start_num>] [-re <end_num>] -h: help: displays list of options for command $0 -rs<...
1
vote
2answers
145 views

Source of information - command who

I would like to know how the command "who" pulls out information about ssh history into a Linux system. For example, on my shared-network workstation, where everyone can ssh into it: [johny@gandor ~]$...
2
votes
1answer
57 views

cron script cannot find logwatch and chkrootkit

I have an issue that has probably something to do with the PATH variable. This is a email I got with error about a script running in cron: Cron Daemon <mail.org> 05:08 (15 hours ago) ...
2
votes
2answers
155 views

Command not executing over SSH

I made this script for a course. It executes commands through ssh from the arguments of the script, on a number of remote servers specified in a file: #!/bin/bash # The server file. Can be changed ...