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
0answers
5 views

how get chat command REPORT file

I want to report a file from the chat command This is possible, and in some of the explanations say about this feature of this command : -r Set the file for output of the report strings. If you ...
0
votes
1answer
38 views

How to replace matching words defined in one file on another file?

I have file1 and file2 as shown below, file1 (org8:0.00000001,org9:0.00000068,((org28:0.00137458,(org30:0.00146077,org4:0.00127170):0.00066024):0.00262422,(org14:0.00384582,(((org29:0.00000521,org7:...
1
vote
1answer
19 views

Output fdisk bash command to multiline variable

I can't seem to figure out how I can put a fdisk command from a bash script in a multiline variable. Here is my code hdds="$(sudo fdisk -l | grep "Disk /dev/sd" | awk '{print$2}' | sed 's/://g')" ...
0
votes
1answer
16 views

how to remove/update the existing user without losing permissions on files already created [on hold]

How to remove/update the existing user without losing permissions on files already created in a windows file server? if anyone can help with the unix/linux command
5
votes
2answers
246 views

How to generate list of *all* available commands and functions?

In Linux (I am using CentOS 7), there is a built in functionality to view all runnable commands. The command is run by pressing tab twice in the console followed by the prompt: Display all 1130 ...
0
votes
2answers
48 views

Command for getting path to mount point of current partition/drive?

Is there an alternative command that does the same thing as findmnt -T . -o TARGET |tail -n 1? Example: If my current working directory is /media/username/HDD/subdir1/subdir2, that command would ...
0
votes
1answer
25 views

Change command to find any text

I have this line of command to find and remove the string: text_to_remove(SOME_VALUE). find . -type f -name "*php" -exec sed -i 's/text_to_remove(SOME_VALUE)//' {} \+ It works fine, but problem is ...
2
votes
1answer
14 views

Creating new elements with xmlstarlet

I have been trying to to add new elements to an XML file. Original file: <levela> <levelb> </levelb> </levela> I'm trying to get the following result: <levela> &...
0
votes
0answers
23 views

aa command in openwrt

I used to send AT command at openwrt in the old version, for example, using the command aa / dev / ttyusb3 at+csq with aa command But I do not know the name of the package Is this package ...
0
votes
1answer
20 views

Locating a process ID by CPU usage (Ubuntu) using AWK

I have a command that I run to try and list PID's and their CPU usage. I am using ps -ef. Is there a (better) way to do this using top? Also, I had a question about my awk statement. My variable $...
0
votes
3answers
89 views

Linux command to find and delete Files which contain a given text

Is there a terminal command to delete files which contain a given text? Let's say I have three files and some of them contains the text "extract($_REQUEST)": file-1.php: This file contains the text "...
0
votes
1answer
12 views

CronJob command to delete multiple subdirectories by name in a given directory

I have two IP cameras which are sending image snapshots to an FTP server every 10 seconds, from 08:00 to 20:59. The directory structure looks like this: `-- public_html `-- securitycams |-...
0
votes
1answer
19 views

Escaping quotes and apostrophes through ssh command execution

I would like to execute the following command through ssh: echo "trap '/tmp/test &' 2 9" >> /tmp/output.txt I am trying to do as follows: ssh 127.0.0.1 -T "echo "trap '/tmp/test &' 2 ...
0
votes
1answer
27 views

Does the “watch” command put stress on a scheduler?

I have an account on a compute cluster which uses the SLURM scheduler. I have some jobs in the queue and I'm using the "watch" command to see their status: watch squeue -u myUserName Does constantly ...
0
votes
2answers
43 views

Searching whole system for files with specific inode [duplicate]

I technically know how to do all these things, but combining it is problematic. Inode is saved in first line of text file (I can eventually read it directly from file), I need results saved to the ...
1
vote
2answers
40 views

Save output of multiple commands to the same file [duplicate]

For example whoami and date. I can do this that way whoami>/home/user/folder/file date>>/home/user/folder/file But i'm sure it can be done in one line without typing path two times. I have ...
0
votes
1answer
21 views

POSIX command for `which --all`, to list all on PATH not just first?

Many shells have an --all flag to which: --all, -a Print all matches in PATH, not just the first But which is not POSIX-compliant; shellcheck points us at command -v. command however has ...
-4
votes
0answers
29 views

Getting 'owner name' 'total size of directory' and the 'directory name'

I am working on a space monitoring module. Is there any easy way to get Directory owner name, total size of directory and the directory using an Unix command?
0
votes
1answer
20 views

Is there a simple way of determining which executable is being invoked by a given command when which is not available? [duplicate]

I am working in a linux system that does not have a which command. Is there an alternative way of finding out which executable is being run by a given command in bash? It is a super basic system (...
0
votes
2answers
56 views

Copy every 10 files from source into a target directory using cp

I have 110 large files inside a directory. But I cannot copy them at once since the system gets timed out after 50 min. I want to copy files 1 to 10, next 11 to 20, next 21 to 30, and so on. The order ...
0
votes
1answer
22 views

Why can't echo and printf output variables that have only whitespace characters? [duplicate]

var1=$(printf "\n\x0A\n") var2=$(printf "\na\nb\nc") Using Android Terminal, the output of echo -e "$var1" (same for echo and printf) iss nothing, not even the 3 new lines. But echo -e "$var2" or ...
0
votes
2answers
38 views

Add a word in end of each line starting with > in a file using unix command

I have a text file containing ~25000 fasta format sequences, I want to add a word in end of each line starting with > .
0
votes
1answer
54 views

Running command in a variable [duplicate]

It is often said that variables should be double quoted when used. In the following example I want to have the command echo "You can't see me" in a variable and run it in such a way that the output ...
0
votes
2answers
44 views

Use grep command to read a file from specific line number to end of file

Suppose I have a file which is getting appended in every seconds/minutes. At first time I have read whole file and stored the last line number(eg: last_line_numer was : 2000) later I want to read file ...
0
votes
1answer
23 views

Extract some portion from line with regular expression

I have file which consist lines like : 50.57.61.8 - - [04/Apr/2019:09:52:01 -0400] "GET /tracker.php?q=1&p=2 HTTP/1.1" 302 20 "-" "Rackspace Monitoring/1.1 (https://monitoring.api.rackspacecloud....
0
votes
0answers
26 views

Easier way to run remote and monitor remote commands

I'm currently leveraging Ruby in a docker image to run some commands on my local Linux system via SSH and Tmux. However, this isn't feasible since I can't figure out a way to actually monitor the ...
0
votes
3answers
106 views

Safe way of running an equivalent to rm -rf * [closed]

I have a task which contain a series of manual steps. One of the steps is to execute rm -rf *. Everything in the folder does need to be deleted but this seems a little dangerous for example. if the ...
0
votes
1answer
54 views

Default python command points to anaconda instead of /usr/bin/python

I've somehow messed up my python installation, while trying to update to Ubuntu 19.04 from 18.10. The python command points to my anaconda's python instead of /usr/bin/python. > which python /...
0
votes
1answer
37 views

What is the command to display disk usage of current directory?

Which command in Unix is used to display the disk usage of current directory?
0
votes
1answer
43 views

A command to know if some file are “only” an hard link and “not” a symlink [duplicate]

I need a command for an if condition to know if 'file_name' is an hard link (not symlink). Thanks
2
votes
1answer
48 views

I need a command to know if a file is linking to another file

How I can know if file1 is a symbolic link to a file2? I need an if condition.
0
votes
2answers
48 views

Linux way to get Summation of elements on right [duplicate]

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
13 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
215 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
17 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 ...
1
vote
0answers
134 views

Why does this rsync command running in a cron fail?

Why does this rsync command running in a cron fail and how to debug it and fix? unset SSH_AUTH_SOCK && unset KRB5CCNAME && rsync -hvru -e "ssh -p 34503 -i /root/.ssh/...
0
votes
0answers
32 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
74 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
40 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
87 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
47 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
28 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
167 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
158 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
37 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
29 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
50 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
22 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
63 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? ...