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 ...
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
1answer
39 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 (...
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" ...
-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 ...
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
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
48 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
55 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 ...
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
64 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 ...
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
45 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
409 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 ...
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
43 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 ...
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 ...
0
votes
2answers
42 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 ...
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 ...
-1
votes
1answer
38 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
31 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
62 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 ...
1
vote
1answer
27 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, ...
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 content....
1
vote
2answers
47 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 ...
-2
votes
1answer
26 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
10 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.
0
votes
1answer
40 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
1
vote
2answers
57 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
31 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
27 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 ...
0
votes
1answer
23 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 ...