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

1
vote
1answer
13 views

Different command outputs

I entered same command with a variable host. During 2nd time I entered blank space between host,= and $. Why it was trying to connect to a server ? Also, when I write like $(host name), I am getting ...
17
votes
6answers
52k views

Delete 100 lines from vi editor using single command

I am using Ubuntu and trying to delete all 100 lines from vi editor but I got interview question of doing this in one command.
-1
votes
2answers
25 views

Linux passwd User permission change

When I look at usr/bin/ directory, I saw the command line with passwd -rwsr-xr-x. 1 root root 30768 2012-02-22 20:48 /usr/bin/passwd and It allows to change to get root's authority. with s. I ...
0
votes
0answers
24 views

Unable to copy file from linux server [on hold]

I have to copy a data of 460Gb from linux server to 2tb external hard drive. I used the normal method of copying data. But it shows an error message that my hard drive has insufficient space. I check ...
7
votes
6answers
3k views
0
votes
1answer
845 views

Downgrade Centos 7.2 to 7.1

I am currently using Centos 7.2.1511(check from file /etc/redhat-release) and trying to downgrade it to Centos 7.1.1503 (due to some package installation issue in centos 7.2) using the command yum ...
11
votes
5answers
9k views

How to randomly sample a subset of a file

Is there any Linux command one can use to sample subset of a file? For instance, a file contains one million lines, and we want to randomly sample only one thousand lines from that file. For random ...
1
vote
2answers
23 views

Append a “finished” command after a specific command is used

I'm using Bash. I have a build command that I run a few times a day. I also have a command called "beep" that I use to alert me when a command finishes. So normally I do "build arg1 arg2; beep" and it'...
1
vote
2answers
39 views

How ifconfg fetch enabled NICs?

I have searched this for a while, but there was no clear keyword to find same question. Briefly showing my question: ifconfig only shows enable NICs. # ifconfig br0 Link encap:Ethernet ...
1
vote
2answers
1k views

Linux Mint XFCE, command to launch menu

What is the command that launches the whisker menu in the Linux Mint xfce edition. For another distribution that used xfce it was xfce4-popup-whisker menu but that doesn't seem to work. I would like ...
1
vote
0answers
11 views

Avoid delays from network calls in logon and logoff scripts

I'm trying to tune some scripts in my test environment. My test environment is specialized and it exists to test software. The software includes Botan, Cryptlib, Crypto++ and OpenSSL. Whenever I log ...
0
votes
1answer
42 views

what is difference between l and ls commands [duplicate]

ls command shows the following : a code controller.js mani sparat this ubuntu.gif l command the shows similar to that : a/ code/ controller.js mani/ sparat/ this/ ubuntu.gif What is ...
0
votes
1answer
22 views

Continue monitor web server and download newly added files

What are the best way to continuously monitor a web server (HTTP) and download newly added file with min. delay (ideally < 1min. delay)?
3
votes
1answer
57 views

What was the first Unix platform to have the 'yes' command?

I have just answered this question on SO, and it fired off my curiosity a little. So I've searched around but can't find an answer ('yes' is a difficult thing to search for!) There are related ...
3
votes
1answer
41 views

Scroll to the last command on Terminal? (like OS X Terminal marks)

Mac OS X Terminal marks are incredibly useful. For example, when I type a command that echoes a lot output, it's easy to read the beginning with Cmd+Up. It will scroll to the last command and ...
0
votes
0answers
19 views

What is difference between kill [pid] and kill -9 [pid] commands? [duplicate]

I've been using "kill -9 [process_id]" command to terminate the process such as hanged process. However someone told me it is better to use "kill [process_id]". Are there different consequences other ...
7
votes
4answers
300 views

Execute a command where a file is found

How do I execute a command where a file is found? Consider I've an directory named testdir that contains the following: $ ls -R testdir/ testdir/: dir1 dir2 dir3 dir4 dir5 testdir/dir1: doc1.pdf ...
2
votes
4answers
47 views

How to check which binaries depend on certain files in /lib?

I know that if I do the command ldd <name> on a binary file in /bin or /sbin I can see which libraries it uses. How do I do the reverse? I.e. do a command on a file in /lib and see what binaries ...
1
vote
2answers
48 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
47 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 ...
4
votes
2answers
10k 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
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
43 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
36 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
25 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
22 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
379 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 ...
31
votes
7answers
136k 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
72 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 %VSZ?...
5
votes
3answers
7k 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
41 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
64 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
52 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 user@ServerIP:/public_html/...
29
votes
2answers
82k 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
60 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
14 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
613 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 /usr/...
0
votes
2answers
38 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 ...
18
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
28 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
55 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
26 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
46 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 ...