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
2answers
59 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 ...
0
votes
1answer
978 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 ...
3
votes
2answers
38 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
50 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
46 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 ...
1
vote
2answers
43 views

Inline Crontab Commands?

Is the following crontab possible? 0 4 * * * /sbin/sudo shutdown -r now I want to run a single command, sudo shutdown -r now, from a crontab without having to put it in a bash script.
0
votes
2answers
231 views

Why does this compound command report errors when copying directories?

If one executes the following two commands in one line as follows, rm -rf dir ; cp -r dir2 dir it may return that cp can not create directory dir/subdir: File exists but if these two commands are ...
4
votes
4answers
16k views

What is the difference between ps and top command?

What is the difference between ps and top command ? I see that both can display information about running processes . Which one should be used when ?
0
votes
1answer
40 views

command not found using sudo in script

I am trying to execute sudo command inside a bash script. #!/bin/bash sudo node app.js and it throws me : sudo: node: command not found If I try to execute only node app.js (without sudo ),it ...
2
votes
2answers
32 views

Recursive comparison and deletion (without rsync or hashing)

I've been using rsync to synchronise folders and it works well. The problem is that more recently I've started syncing folders with larger files in them, and it takes much longer than I'd like it to (...
7
votes
3answers
8k 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
0answers
35 views

How to Rename files in subfolders with subfolder name? [duplicate]

The directory structure is as follows: PWD/ A1/ acc.bam A2/ acc.bam A3/ acc.bam A4/ acc.bam All the acc.bam files should be renamed with subfolders names. For eg: "acc.bam" ...
17
votes
6answers
54k 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
33 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 ...
7
votes
6answers
3k views
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
25 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
41 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
13 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
49 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
26 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
61 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
56 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
303 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
54 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
67 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
50 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
11k 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
46 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
56 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
29 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
412 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 ...
33
votes
7answers
143k 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
124 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?...
0
votes
2answers
44 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
63 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
90 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
55 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/...
34
votes
2answers
90k 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
78 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
631 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
43 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 ...
21
votes
2answers
7k 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
41 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 ...