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
37 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
60 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
30 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
40 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
12 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
30 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
15 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
34 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
19 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
28 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
46 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
23 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 ...
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 ...
-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
8 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
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
1
vote
2answers
45 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
29 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
25 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
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 ...
3
votes
2answers
63 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
29 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 ...
0
votes
0answers
47 views

avconv output_volume option - trying to understand the man page

I'm trying to increase the volume of my input .wav file by means of the output_volume option within the avconv command. I would like to increase the volume by 6 dBs similarly as demonstrated in the ...
0
votes
2answers
57 views

Linux command clarification

ls -l | grep -v '^d' | sort -g -r -k 5 | head -2: I used this command to write into a text file. I've researched a bit online and I think these commands mean this: grep: a search that searches for ...
0
votes
1answer
51 views

How to Move Large Number of Files to Original Directories?

I accidentally ran a command that moved the contents of all the subdirectories in my home folder to my home folder. Should I call it a loss and reinstall my system, or is there some command(s) I can ...
0
votes
4answers
120 views

bash : multiple command on one line with different exit code

I run a bash command from a c++ code using the system function provided in cstdlib. My question is not about the c++ implementation, but the one thing that is relevant to my question, is that I have ...
-1
votes
1answer
23 views

Statistics of System usage time (time of day, day of week)

I once found a tool that printed a huge amount of statistics about the time of day and day of week of computer usage when invoked. Unfortunately I don't remember the name neither did Google reveal it ...
1
vote
1answer
69 views

Something confusing about “su -” and “su” [duplicate]

I am studying the Linux command line. But the book which I'm reading says that su -l(-) username is starting a new shell session and loading the environment of the user I want to change to, but su ...
0
votes
0answers
29 views

Is “<command> &” same as demonizing a process in Linux? [duplicate]

We all know that any command succeeded by ampersand (&) makes it run in the background. Can we use it instead of demonizing tools? For example: In order to run nodejs server, we use use packages ...
1
vote
3answers
75 views

Type and the speed of CPU using the lscpu command

I want to determine the type and speed of my CPU so I executed the CPU command, However, I have some confusion, so from my output I can't really determine what is my CPU type and my speed is 1600 ...
3
votes
2answers
78 views

How can I type a command to execute when the current command completes?

I have a function (not) that displays a notification. Hence, I can use it to show when a command is complete. sleep 5; not However, sometimes I forget to add ;not. In OS X's terminal (a few years ...
1
vote
1answer
65 views

how concatenate two commands?

Please can someone help me to concatenate two commands on shell, I'd have the path result and concatenate with the number of column in the first field. EX: #this gives me the path of my path ...
1
vote
1answer
60 views

What is the difference between getty and agetty?

When I looked in the manual for agetty all I saw was alternative getty
0
votes
1answer
590 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 ...
0
votes
1answer
63 views

Execute custom command in Geany

I want to execute some command with currently edited file as argument from within Geany, triggered by keyboard shortcut. For example: I am editing /home/user/file.txt and after hitting "Ctrl+B" I ...
0
votes
1answer
62 views

Count the number of files with yesterday's date in ls's output

I would like to count the number of files with yesterday's date in ls's output. I tried: yday=$(date --date="yesterday" +"%b%Oe") ls . -ltr | grep $yday | wc -l The problem is that files have dates ...
0
votes
2answers
70 views

Resource usage (% CPU) for given command on OS X

The time -v command outputs % CPU utilization for a given command on Linux. How do I do this on OS X? The Linux/OS X difference is illustrated here. I would like to measure multi-core utilization ...
7
votes
7answers
560 views

How to rename splitfile[a-z] to splitfile[1-26]

I am trying to rename files named in the form of splitfile[a-z] to splitfile[1-26].csv, that is I want to rename splitfilea to splitfile1.csv and so on. I tried the following command: mv ...
3
votes
1answer
314 views

ss - linux socket statistics utility output format

When using ss with -p option, user/pid/fd column jumps underneath the particular line. For instance this is it what I'm actually seeing: # ss -nulp4 State Recv-Q Send-Q ...
6
votes
2answers
101 views

What does “is hashed” mean when using the type command? [duplicate]

I was reading this post and trying out all of the commands in the first answer... I don't really have anything else better to do right now. Anyways, I ran through them all in regards to rm. What ...
0
votes
1answer
29 views

Whatis command (shell builtin vs executable programs)

I know that whatis command is used to output a brief description about an executable program (Command). So both whatis cd whatis type Will print: nothing appropriate (Because from my ...
2
votes
1answer
45 views

Go to the directory where the executable command lives

This is a command-line trick from a book-"The Productive Programmer": pushd `which java`/.. The author says this command can temporarily go the directory where the executable command java lives. ...
1
vote
1answer
35 views

running commands from files [closed]

Let's say that I write some commands in a file let's say cmake although it doesn't need to be cmake run writing some commands in a text file. example filename: cmake_command cmake ...
-1
votes
1answer
30 views

What's the meaning of (1) in the man page? [duplicate]

With man bc, I have a line starting with bc(1). bc(1) bc(1) NAME bc - An arbitrary precision calculator language Some of ...
1
vote
1answer
74 views

How can I change lsblk to show model by default?

I'm currently running Arch. I simply want to change lsblk to always display as if the-o model was selected in addition to the standard options. I suppose I could rename lsblk and put a copy in the ...
2
votes
1answer
60 views

Run a command stored in a variable to echo into a file

How can I get the stored command to work for the following scenario: CMD='echo "test" >> test.txt' $CMD It will work for other scenarios like: CMD='mkdir test' $CMD
0
votes
2answers
37 views

URL instead of file in linux command parameters

Is there a way to put URL of a file instead of a file in parameters of a linux command? To be specific I am looking for a way to store dhcp.lease file remotely but dhcp accept just file. How can I do ...