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.

learn more… | top users | synonyms

3
votes
3answers
342 views

Is the exit status of a command implemented by the command or a shell process which executes the command?

From bash manual The exit status of an executed command is the value returned by the waitpid system call or equivalent function. Exit statuses fall between 0 and 255, though, as explained below,...
1
vote
2answers
16 views

Folder named “.” in a gzipped archive

I created an Ubuntu minimal installation on a VirtualBox VM. Then, I decided to archive it so that I could share it with friends. I am letting them use it so that they can experiment with Linux ...
-4
votes
0answers
30 views

RH 6.0 - Terminal problems [on hold]

I have one problem using Linux Terminal: when I open the terminal and type any command like vi sum.c and press ENTER then the terminal screen is automatically gets smaller and finally closes itself. ...
-6
votes
1answer
58 views

How to create new script , role like wc [closed]

I would like to create a new .wc command , but I have no idea how to proceed. Can you help me?
0
votes
0answers
12 views

Kali stuck in boot on my raspberry

I have installed fresh kali on my raspberry Pi3 it was perfect. recently i have decided to add 3.2 tft display on board to my raspberry so I have searched and followed the instruction for Adafruit and ...
1
vote
0answers
30 views

Whats the Konsole Command to Lock Screen

Im using OpenSuse Leap 42.1 and im trying to remap my Keyboard. Now i want to remap one Key (The Sleep-Key) to Lock the Screen instead of putting the entire PC to sleep. For that I need the Konsole-...
0
votes
0answers
41 views

How to install wireless USB adapter driver in CDLinux 0.9.7.1?

I have one wireless LAN card and one wireless USB adapter: 802.11n Wireless LAN Card - Ralink Technology, Corp. 300Mbps Wireless N USB Adapter TL-WN821N CDLinux recognizes the first one without ...
1
vote
0answers
35 views

mapfile and redirection issue

I would like to redirect the output of a command to input of mapfile. I'm doing this and it's working: xls2csv -x $files -W -q | sed '/^$/d' | grep -v '^The' > lista.txt mapfile -t titulos < ...
1
vote
3answers
52 views

Command find and tar in script

I'm trying write a script which requires user interaction. Basically, the script has to ask user about 3 parameters: name of the file(s) which user wants to find, the number of days during which the ...
0
votes
1answer
16 views

OpenSSL verify: missing flag “-allow_proxy_certs”

OS: Ubuntu 14.04 Trusty Openssl version: OpenSSL 1.0.1f 6 Jan 2014 I'm trying to verify a proxy certificate. If I use openssl verify -CAfile myca.pem mycert.pem I obtain this error: error 40 at ...
0
votes
1answer
23 views

Having trouble running a command as another user on Ubuntu

I'm using Ubuntu 14.04. When logged in as root, I'm tryhing to run a command as anotehr (postgres). However, it is failing root@remotebox:/home/rails/myproject# su - postgres 'pg_upgradecluster 9.3 ...
0
votes
2answers
38 views

How to make alias trailing with space hack works with parameter supplied

I have two aliases watchExpand and l. I know that you can make bash expansion work with aliases by placing a trailing space like so: alias watchExpand='watch ' l is aliased to ls -larthiF --context. ...
6
votes
1answer
308 views

Get complete last row of `df` output

I would like to execute the command df -h /etc/nginx/access_log_backup_directory/ | tail -1 Depending on the file system lenth the command df -h /etc/nginx/access_log_backup_directory/ gives the ...
1
vote
2answers
56 views

Strange hang “ls -l” or “dir -l” not working [closed]

I have a strange behaviour on a Debian server. Context : Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u5 (2015-10-09) x86_64 GNU/Linux User : root Commands ls, ls -a, ls -1 or dir work ...
1
vote
0answers
12 views

Command to print the CPU/RAM usage during the duration of another command/script

I am doing some performance testing on a tool I wrote consisting of an elaborate set of python scripts, yml files, etc. I have been using the time command before running my primary python script so I ...
0
votes
3answers
41 views

Run command output lines as another command in linux

I am running this command : find ./ -type f -printf "wc -l \"%p\"\n" which gives this output: wc -l "ANLS 457567.pl" wc -l "ANLS 457567.pl" Now I want to run this whole line as another command. ...
0
votes
0answers
30 views

Replacement of strings using regex with sed

I am trying to replace this: mysqli_query($query_tpl2,$linkid_log); with: mysqli_query($linkid_log,$query_tpl2); where query can be anything (any word, that is). I have this seemingly working reg ...
-1
votes
1answer
27 views

Unexpected end of file in shell script [duplicate]

Here's my script #! /bin/sh source=/Source/$1 destination=/Destination folderParam=$(basename $source) if /usr/bin/rsync -avh -r $source $destination; then cp /FolderCopyStatus/Success /Status/...
3
votes
2answers
43 views

Is there a way to check that a specific command is successful

I know that $? gives the status of the previous command but how can I get status of a particular command. rsync -avh -r /Source/ /Destination/ folderParam=$(basename !:3) //commandResultvar : here I ...
-3
votes
1answer
167 views

Is “tree” command not available for Kali Linux?

I tried to execute "tree" under Kali Linux, but it tells me command not found. I thought "tree" was a standard command for all Linux OS, do I need to install it or is there a substitute for Kali ...
3
votes
1answer
98 views

Rename files in linux using regex pattern

I want to rename many files like Tum Hi Ho [www.DJMaza.Com].mp3 to Tum Hi Ho.mp3 To do so, I used this command. But somehow it is not working. `rename -n 's/(.*)([.*])(\.mp3)/$1$3/' *.mp3`
-2
votes
2answers
33 views

Why am I unable to save my output to a file from a command that takes input as the file itself? [duplicate]

For example, here's my command I'm using: tr -d '\n' < newfile.ppm I want to output the results to that exact same file, so I am now doing: tr -d '\n' < newfile.ppm > newfile.ppm Why is ...
0
votes
2answers
84 views

Read first file in a list of files within a directory [duplicate]

I wanted to read the first text file in every directory using "cat or vi". To clarify the issue: The Folder_A1 contain 1000 text files. The files named in the following format "i.1351". All the files ...
0
votes
0answers
48 views

Grep after piping not working always

I'm using OS X El Capitan, connecting to Ubuntu 16.04.1 LTS via ssh, using oh my zsh in the server. Well this is what happens: ➜ dir cat nohup.out | grep 509 zsh: command not found:  grep ➜ dir cat ...
0
votes
0answers
15 views

Set acl on hadoop

I need to write a script that set an ACL on only the last directory and another ACL on all other directories. How can i do this? I'm working on hadoop so i can't use some unix commands. The paths ...
1
vote
3answers
39 views

Using 'find' in the command line

The computer is running Yosemite. I was trying to move a couple documents from the download folder to documents via the command line using find . -iname '*.pdf' -exec mv "{}" ./Documents \ The ...
1
vote
2answers
38 views

Forbid use of specific commands

I develop tools on a cluster. Each user loads common environment files in their .bash_profile. I have a login node on which certain tools should not run. How can I prevent users from using those tools ...
1
vote
1answer
51 views

How to provide command arguments as an array? [closed]

I'm trying to test if an archive has all its files. All I need to do is a simple unzip and then make. The shell keeps trying to interpret arguments like -aoq as a program. Other errors exist as well, ...
1
vote
0answers
11 views

Command mapping utitly

I need a way to alias commands depending on their directory. One of the use case is to be able to call different version of ghc-mod from Emacs depending on which project am working on. I can't see set ...
1
vote
1answer
36 views

How to copy a folder using the install command

I'm fixing a package in Arch Linux, and I still cannot understand properly how the install command works. I've checked the man and is quite vague. My question is: How can I copy a folder using ...
1
vote
1answer
29 views

How to create a new command and how to view the code for commands

I don't exactly know the difference between a script and a few pages mention that there is almost no difference between them but I do wonder why to execute a command all we need to do is type its name ...
1
vote
1answer
579 views

Compute bcrypt hash from command line

I would like to compute the bcrypt hash of my password. Is there an open source command line tool that would do that ? I would use this hash in the Syncthing configuration file (even if I know from ...
0
votes
0answers
28 views

Devtoolset-4 and Jenkins

I want to enable devtoolset-4 on a Red Hat 7.2 Enterprise System. So, in a bash script in Jenkins I added this command source /opt/rh/devtoolset-4/enable. When I now run this script, I get a failure. ...
0
votes
0answers
14 views

How to check which file is consulted while running a certain command? [duplicate]

Say I'm running the lastlog command. How can I find out which file this command is consulting? I know that I can check with which lastlog or type lastlog the path to the command but how can I check ...
1
vote
1answer
150 views

Create binary file of specific length

I wish to run a command which will create a binary file where the length of the file is specified on issuing the command.
1
vote
1answer
28 views

Until - for loop usage

How can I use the loop "until .... do" with a for loop?. For example, in the following for loop, the "for loop" and the commands "command # 5, #6, #7" are runnig at once. For i in $(cat file.txt), ...
0
votes
0answers
13 views

What does '(3)' mean in 'SYSLOG(3)'? [duplicate]

I see many commands' manuals wih command(number), what does the number mean?
2
votes
1answer
87 views

Bash check if USB device is bound in /sys

I have a bash script that bounds/unbounds an USB device by setting a driver's value in the /sys directory. Here are the commands: 'X-Y.Z' is the device's address. Bind device: sh -c "echo 'X-Y.Z' &...
1
vote
2answers
158 views

sudo rm -rf --no-preserve-root / vs sudo rm -rf /*

As everyone knows, these are two deadly unix commands that both tell a machine to commit suicide. But what is the difference between the two? The first one deletes the root directory, while the second ...
1
vote
5answers
68 views

what is the location of custom commands

where can I find the description/details of the custom commands. In my linux server there is a custom command named qsubm that I need to check, but I don't know where it is written.
1
vote
2answers
38 views

How do I reference an original command, so I can replace it with a function

So I am trying to create a simple function to replace the standard who command with my own, similar to a function I use to replace the standard cd command. Goal: Replace original who command with who ...
3
votes
2answers
45 views

How to use commands on files inside directories starting with a special character?

The Angular 2 style conventions says that lazy loaded folders should start with a plus sign (+). This works fine when doing cd +directory/, but becomes problematic when using commands on files ...
0
votes
0answers
26 views

Is there a more feature rich version of the time command? [duplicate]

Is there a command that will take stats on a given command like the time command, but with more than just time and cpu stats. Ideally a command that at-least tracks a given commands ram usage in ...
-1
votes
2answers
62 views

Run command after login

Hi(Sorry for my english). I have Linux Mint 18. How can run this command after login with main user (no root user) : sudo echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null I read so ...
0
votes
1answer
38 views

Can I edit executed command's informations?

Where does Linux store it's installed packages, that show information in terminal when they are executed? For example, if I run ifconfig, it will display some information (interfaces, and their IP ...
0
votes
2answers
73 views

failure to install many commands in ubuntu-14

Being that hapless user who straggled with "bash-shell" (I finally decided to install tshell instead -- too much trouble fixing all the old scripts), I run into another trouble: my ubuntu-14 doesn't ...
3
votes
2answers
225 views

Hide arguments of commands in ps

I run an application on a linux server, and when I run the application I supply the password as a command line, like this: ./myapplication --smtp-password mypassword In our application, we didn't ...
3
votes
2answers
42 views

Dividing numbers in the same cells between two “Comma-separated values csv” files

I have two Comma-separated values (csv) files. Each file has 1000 columns and 1000 rows ( i.e. every csv file form a matrix 1000x1000) The values for every cell in the first csv file represent the ...
1
vote
3answers
56 views

How can I identify which directories are on a different file system?

Imagine I am in a directory (e.g., /mnt) where some of the directories are mountpoints of another file system, and other directories are legitimate directories on the same filesystem. Can I issue a ...
0
votes
2answers
55 views

Command “paste - - - - ”, how to specify a big column number

In command paste - - - -, numbers of - is equal the future column number. In my case, I have 55,000 future column, for me wont need to put 55,000 - what I will can use? Example: title1:A1 title2:A2 ...