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

0
votes
2answers
30 views

How to run multiple programs in one single terminal window?

I would like to write a script that runs multiple programs/commands 'program1', 'program2', 'program3'... in a mosaic of terminal in one single window using gnome-terminal and also using tmux (I mean ...
1
vote
3answers
37 views

Does it make sudo more secure when indexing all commands by their SHA-2 checksums?

I'm asking myself whether system security substantially increases when I generate a security policy, i.e. sudoers file which contains one or more Cmnd_Alias definitions that enumerate all executable ...
-2
votes
1answer
27 views

How to view an specified user's pemissions in linux? [on hold]

can anyone please suggest me how to find out the permissions of a specified user in linux? I'm getting the information regarding the files/groups etc. But I need specific users permissions ...
4
votes
2answers
9k views

What is difference between pbrun and sudo command?

What is difference between pbrun and sudo command? I have seen people executing pbrun sudo su - what this means? I know su -, it will try to switch to root user. What speciality pbrun gives to sudo ...
0
votes
1answer
24 views

How to install in /usr/bin directory? [closed]

I'm new to Unix. To install gcc-6.1-bin.tar.gz in /usr/local, I type sudo tar -xvf gcc-6.1-bin.tar -C / But how do I install in /usr/bin rather than /usr/local? (The reason I want to install in ...
0
votes
0answers
12 views

What are some apps to display a daily status update when you log into your shell? [closed]

To make my shell more friendly, I'd like to have it give me a daily status update whenever I log on (or run the conceptualized mystatus command). For example: It could display my commit history ...
0
votes
0answers
23 views

What is the difference between '[' and '[['? [duplicate]

(Hope this is no duplicate) So I have a part of script like this: $ a='f' $ [ $a = [fF] ] && echo yes || echo no no $ [[ $a = [fF] ]] && echo yes || echo no yes So, why do the ...
0
votes
0answers
42 views

Command is working in terminal/puTTY but not in shell script

I have set up a CS:GO server on my Linux server and have a script so restart/stop the server. In both cases a message should be printed out to the server. To accomplish that I'm using following ...
1
vote
0answers
29 views

Email not received with mail command from terminal in CentOS

I am trying to send mail with the following command: echo "Hello" | mail -s "Hello" myaddr@mydomain.com and than checking the exit status as: echo $? which outputs 0 Of course myaddr and ...
2
votes
0answers
23 views

Sometimes my zsh messes the end of lines

I have this strange issue, that I cannot find the source of, nor a solution to solve. "Sometimes" my zsh gets messed up and start display end of lines in a funny way: As you can see, the newlines ...
1
vote
0answers
21 views

How to write decorator commands [duplicate]

I don't know the exact word, that's why I'll use "decorator", like in POO, but I'm talking about the kind of functions you can use before other functions to add any operations to it, like the command ...
4
votes
2answers
371 views

Remove completely all packages I installed?

I was using one Linux server with CentOS7 installed for testing and installing some tools. And now I don't remember how many packages I installed. I want to remove all that packages so my server ...
30
votes
7answers
131k views

How to move all files and folders via mv command

How can I move all files and folders from one directory to another via mv command?
0
votes
0answers
9 views

Use inotifywait to run command but only if inotifywait exits with status 0 [duplicate]

this is probably trivial. Normally I use the below to trigger a command on file event: inotifywait --event close /dir/file && my_command But will this run my_command even if inotifywait ...
1
vote
2answers
54 views

Top command output explanation (in embedded system)

Can someone please help me understand the output that I get from the top command? This is the point that the oom-killer is invoked and kills my main application. What exactly is under the VSZ and ...
5
votes
3answers
6k views

How to permanently enable scl CentOS 6.4?

I installed a newer version of devtoolset (1.1) and was wondering how I would go about permanently setting these to be default. Right now, when I ssh into my server running CentOS, I have to run this ...
0
votes
2answers
40 views

Run a command which returns a string when reading a file [duplicate]

I have this idea and maybe it is not feasible, but I think it worth asking. Let's say a user is running this command: cat ~/file.txt Whenever something tries to read from this file, I would like ...
1
vote
1answer
61 views

how to know the status of a command?

I guess this is a very naive question over even stupid question. That is how to tell whether previous command was successfully carried out or not. I know one way is to use echo $? command: ...
0
votes
1answer
55 views

How to use ClamAV to scan the memory

How can I only scan the computer RAM for viruses using the ClamAV command clamscan? I already tried, because I found it on ClamWin forum: clamscan --memory But it seems, that the Linux version ...
2
votes
0answers
50 views

Combine multiple PSCP commands?

I need to transfer multiple folders from my server to my pc. I'm currently using a command like: pscp -r user@ServerIP:/public_html/folderA "C:\folderA" && pscp -r ...
25
votes
2answers
76k views

ifconfig command not found

I've just installed CentOS7 as a virtual machine on my mac (osx10.9.3 + virtualbox) .Running ifconfig returns command not found. Also running sudo /sbin/ifconfig returns commmand not found. I am root. ...
4
votes
3answers
48 views

No command 'bla' found, did you mean:?

So, when a command is not found, by what means is the "did you mean:" list populated? What program finds these alternate commands? What is the meaning of: "(main), (universe)..."? Can I change which ...
1
vote
0answers
13 views

Where does basictex install command line tools

I'm interested in using LaTeX as I prepare my first scientific paper. I've installed basictex and have been using it through texlive. I'd like to start using the basictex command line tools. I don't ...
7
votes
2answers
586 views

Order of executables started in bash

If I execute the test command in bash, test(evaluates conditional expression) built-in utility is started: $ type test test is a shell builtin $ type -a test test is a shell builtin test is ...
0
votes
2answers
37 views

How does the shell decide which of same-name keyword, builtin, and external command to run? [duplicate]

When there are same-name builtin, keyword and/or external command, what is the order in which the Bash shell decides which to run? For example, keyword time and external command time, builtin ...
17
votes
2answers
6k views

What's the difference between “realpath” and “readlink -f”

I've read a lot about realpath command and how it has been deprecated with the readlink -f being now recommended. I have also seen in some places that the reason why realpath was introduced was for ...
0
votes
1answer
23 views

Sox: Convert the .wav file with required properties in single command

I have an test.wav file. I need to use this file to process an application, with following properties i) monochannel ii) 16khz sample rate iii) 16bit Now, I'm using following commands to attain ...
-1
votes
1answer
36 views

Can I use echo to run other commands using this method? [closed]

I'm still learning unix and I need to know if there is a way to perform the following actions. Is there any way I can echo a read variable, and in the process, dissect it letter by letter, and assign ...
0
votes
0answers
20 views

How to test if a command is installed? [duplicate]

For example, if I'm writing a shell script which: depends completely on a specific command being available/installed, or is intended to make use of a specific command if it is available (and ...
1
vote
1answer
29 views

Bash - Catch input for a substituted command stored in variable

How would I be able to catch the input for a substituted command stored in a variable? Example: How would I be able to catch the input for the following command? bar_foo=$(openssl passwd -1 -salt ...
-3
votes
2answers
49 views

Find and replace in Linux [closed]

I want to replace 0/1 with hetero but whenever I am trying to use the known commands it is showing syntax error because the / is aleady part of the command .. Can anyone suggest a command to solve ...
7
votes
2answers
2k views

Memory usage command with syntax similar to the time command

What command shows the memory usage of a program, i am looking for a command that is simple to use and has similar syntax to the time command. I am trying to find the memory usage of a md5 hashing ...
1
vote
1answer
25 views

Actively monitor the modified date of all files in a directory

Is there a way to actively monitor the modified dates of all files or directories in a current directory? I am using the BASH shell. By actively I mean run a command once and then be able to monitor ...
0
votes
0answers
31 views

Can a command which takes another command as its argument take non-simple commands? [duplicate]

Some commands can take other commands as their arguments. For example /usr/bin/time, and more examples which you may think of. Are these commands only able to take simple commands as their arguments, ...
1
vote
2answers
45 views

Does an external command which takes a command as its argument has restriction on the argument?

For an external command which takes a command as its argument, must the argument be an external command, not a shell's builtin command? I ask this question, based on the following two examples the ...
0
votes
0answers
22 views

How to recover content of the file in unix? [duplicate]

I accidentally gave cat >filename instead of cat filename and my content is lost.Now I have only my file,but content is deleted.How to recover the content alone? Please help me to get back the ...
-2
votes
1answer
21 views

backup from server to computer (SSH)

First of all I am newbie at SSH. Could you tell me, how can I backup files from remote server to computer storage disk? I use Windows and program PuTTy to connect to server through ssh. Can you write ...
0
votes
1answer
9 views

Start playing an audio CD in Deadbeef player with a command

This question is created to share a simple and interesting solution related to this great player.
93
votes
7answers
10k views

Why is cd not a program?

I've always wondered why cd isn't a program, but never managed to find the answer. Anyone know why this is the case?
27
votes
5answers
6k views

The “yes” command

There is a yes command in unix/linux which basically infinitely prints y to the stdout. What is the point of it, and how is it useful?
26
votes
20answers
7k views

How do I print pi (3.14159)? [closed]

What command could print pi for me? I want to specify how many digits it prints, I couldn't find anything online. I just want to be able to print pi.
0
votes
1answer
38 views

Linux commands in vi editor [closed]

I am writing a script and when I select an option it needs to basically run the ls -l function how would I get that format in vi editor as a line command
-4
votes
1answer
840 views

Does curl -Ls 'http://example.com' mean it will not output anything?

Does the s in -Ls mean that nothing should be outputted? If so what will be the output then?
1
vote
2answers
49 views

Where is the hash command documentation?

When I type man hash it shows me man builtin. I'm trying to understand this line: hash -r 2>/dev/null || true What hash -r does and what it returns. Context: export PATH="$PWD/bin:$PATH" hash ...
0
votes
1answer
30 views

How does the diff command handle caching?

I became curious when I was diffing two large (>326MB) files, and noticed that the second run took much less time than the first. This was frustrating, since I was trying to time the second run, to ...
0
votes
1answer
26 views

Delete file returned by “mpc search” with single command

using the mpc search command I can find a the filename of a song like so: mpc search title 'Two Weeks' The output would look like this: Grizzly Bear - Two Weeks.mp3 Since I also know the location ...
3
votes
2answers
72 views

less command with pipe

I learn that pipe (|) is used to pass stdout into subshell's stdin. But, command less must have filename argument like less file1.txt However, when I use command like ls -l /root | less, it works. ...
0
votes
1answer
22 views

ziping all files in a folder without all directories [duplicate]

I used this command to zip all files in a folder : zip -r fixedrom.zip /sdcard/dbtools/zipfix/fix/ ; It works fine but the zip should be like this : Meta-inf Recovery System Boot.IMG Etc... But ...
0
votes
1answer
32 views

Is Basic Regular Expression same as pathname expansion in shell? [duplicate]

I'm learning about regular expression, and they are divided into basic and extended. Basic Regular Expression(BRE) uses meta-character [ ] ^ $ . *. It's works on grep command well. But, when we use ...
1
vote
2answers
38 views

Is it possible to specify a path in which a directory name is variable?

Asking this question on mpv player and dvds, I stumbled into a more generic question: is it generally possible to specify a path in which one of the directory names is variable? Let's say that I want ...