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

5
votes
2answers
342 views

Why is cd not a file in /bin? [duplicate]

Possible Duplicate: Why is cd not a program? I noticed that every other commonly used util, like ls, cp, rm, etc. are actually files in /bin -- but cd is not. Nor is it in any other ...
5
votes
1answer
991 views

Command & binary exists but cannot be executed

I transfered /etc/* files from one Linux server to another and now I have a strange error. Both are Debian Squeeze. When I run a command, e.g. ssh, I get an error: bash: /usr/bin/ssh: No such file ...
5
votes
2answers
47 views

Merging/Combining 2 text files according to numeric field

I have 2 text files file_1: 14595|Age 35|Salary xx|Position ax|2013|Info 1|Info 2|Info 3|Info 4|Info 5 14649|Age 30|Salary xx|Position az|2015|Info 1|Info 2|Info 3|Info 4|Info 5 file_2: ...
4
votes
1answer
443 views

Which 2-letter POSIX command is different from all the others?

I was interviewed for an internship and I got the same question as this one: http://www.glassdoor.com/Interview/Which-2-letter-POSIX-command-is-different-from-all-the-others-QTN_498236.htm The ...
4
votes
3answers
4k views

What is the purpose of -e in sed command?

I can't find any documentation about the sed -e switch, for simple replace, do I need it? e.g. sed 's/foo/bar/' VS sed -e 's/foo/bar/'
4
votes
4answers
715 views

What does <<< mean? [duplicate]

What does <<< mean? Here is an example: $ sed 's/a/b/g' <<< "aaa" bbb Is it something general that works with more Linux commands? It looks like it's feeding the sed program with ...
4
votes
5answers
100 views

unix command to print till 3rd occurence of “/” in each line

I have one file contains data as follows... /tutordashboard/manageTutorLogInStatus/?ua=TQ-AUTOCLOSE-REENTER&filterId=089089087087080&dt=1325757272 ...
4
votes
2answers
545 views

Command completion does not complete the files in the current directory

Something is wrong with my tab completion. Let's say I do this: cd test // works fine, go into test directory ls // works fine, displays all of the files Let's assume I have the following files: ...
4
votes
4answers
606 views

Is there a practical use for the GNU factor command?

Looking through the GNU Coreutils, I spotted the factor command, that I had never noticed before. Reading the man page: Print the prime factors of each specified integer NUMBER. If none are ...
4
votes
2answers
1k views

print command instead of echo in linux

I simply can print a message in terminal using linux echo command. prayag@prayag$ echo "prayag works on JVM" prayag works on JVM Can I have the same output with print command. I actually went ...
4
votes
5answers
1k views

Execute string result from shell script as a set of shell commands

I create a string result from my shell script and i want to execute it as a shell command. For example file_a is: user1@gmail.com user2@gmail.com script: awk '{print "mail -s \"welcome\"", $1}' ...
4
votes
2answers
3k views

How to execute one command on all files within a folder

Saying, I have this tree and I want to execute ruby on all scripts within the folder. How could I archive through one line of command. ./ ../ rb-script/ sample1.rb sample2.rb
4
votes
1answer
5k 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
1answer
58 views

How to update 'command cache' after change of soft links?

I have changed multiple soft links on my system with ln -f -s. When I view the link with ls -l, I see they point to the right target. However, when I try to run the command, it still tries to use the ...
4
votes
3answers
3k views

Split command output by linebreak?

I have a command returning multiple lines. For further processing I need to process each single line of those lines. My current code works by modifying the IFS (Internal Field Separator): ...
4
votes
3answers
1k views

How to find a file with specific permission of a specific user?

How do I get a list of all the files which permission is "read and write" for a specific user. For example, when I go on the desktop of my mac, then right click on file "A", then "get info", then on ...
4
votes
2answers
648 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 ...
4
votes
1answer
636 views

What is the difference between exiting a process via Ctrl+C vs issuing a kill -9 command?

I know I can kill any process with kill -9 command . But sometimes i see that even if I have terminated a program with CTRL+C , the process doesn't get killed . So I want to know the difference ...
4
votes
1answer
179 views

What does the command “$()” do in UNIX?

What does the command $() do in UNIX? Could someone explain what is the significance of $ in the below examples; $(echo var=10) and eval $(echo var=10)
4
votes
2answers
3k views

How to see the total progress while copying the files

We know that if we give --progress parameter to rsync it will show the progress of files copied. But issue is that is shows the progress for each single file not total or overall progress. So how to ...
3
votes
5answers
202 views

find which system is transmitting through a particular port

I am using command nc -lu <port no.> to find on given port any data is receiving or not. I am getting data if there is transmission going on (but don't know from where!). Is there any way that ...
3
votes
2answers
585 views

Redhat Linux: How to know my system configuration?

I am using Red Hat Enterprise Linux Server release 5.9 (Tikanga). For installation of any application, it is very important to know the system configuration, is it 32 bit or 64 bit system, Installed ...
3
votes
2answers
10k views

How to list groups with gid in redhat?

I first listed the groups using : groups I added group using groupadd -g 300 oinstall groupadd –g 500 dba and then when I do groups root bin daemon sys adm disk wheel sfcb I am unable to ...
3
votes
3answers
613 views

Shortening build command

Is there any way I can shorten this openCV build command? g++ file.cpp -o newFileName `pkg-config --cflags --libs opencv` I tried adding: -o newFileName `pkg-config --cflags --libs opencv` to an ...
3
votes
1answer
703 views

Searching a file & excluding lines with a specified string

I have a large log file that contains numerous lines of the same entry, lets call it "repeat-info". As an example here is what a portion of the log might look like: [Timestamp] repeat-info ...
3
votes
3answers
3k views

How to list available app commands in terminal

I'm using fluxbox and recently i wanted to start an application for video editing and i couldn't remember it's name. I usually run apps from terminal so I was wondering is there a way to list all ...
3
votes
4answers
970 views

Generate random numbers in specific range

After googling a bit I couldn't find a simple way to generate with a shell command a random number included in a specific range, between a minimum and a maximum. I read about /dev/random, ...
3
votes
1answer
9k views

Does Linux allow executing the “rm -rf / ” command? [closed]

We all know that we have to use the -rf option of rm command carefully. What I wonder is does Linux allow executing this command: rm -rf /? If so, why? This command could have disastrous ...
3
votes
2answers
353 views

Please explain the -f option in pgrep

man pgrep says the following about -f option: -f The pattern is normally only matched against the process name. When -f is set, the full command line is used. What does it ...
3
votes
2answers
285 views

Make copies of a single directory to multiple directories with different names

I'm trying to replicate a single directory (with sub-directories) to a bunch of new directories based on a list. For example I can: mkdir Fred Barney Thelma Louise Foo Bar How would I copy a premade ...
3
votes
2answers
142 views

How to use getopt in bash command line with only long options?

There is a getopt command in bash command line. getopt can used with short options (such as getopt -o axby "$@"), and can be used with both short and long options (such as getopt -o axby -l long-key ...
3
votes
1answer
40 views

Switching users without the - symbol

I had to switch to a different user earlier for something that I was working on. I have originally done: su support While I was successfully able to switch to support, I found I was unable to make ...
3
votes
3answers
577 views

Correctly parse arguments in script behaving like a shell called through SSH

I have a server with a very limited used whom I want to be able to run two very specific (and custom) instructions through SSH. In order to do that, I have set the shell for that limited user to be a ...
3
votes
1answer
149 views

command not found handle doesn't work for url

I'm trying to setup the command_not_found_handle for URL links, %> command_not_found_handle() { echo "OK"; } %> aaaaa OK %> http://www.google.com bash: http://www.google.com: No such file or ...
3
votes
2answers
776 views

is there any command like “wall” that runs a “command” in all terminals

as you know "wall" command sends a message to all terminals: wall message now my question is this: is there any command that can send a "command" to be run in all terminals? for example sending ...
3
votes
1answer
2k views

Make awk use bash with the system() command

Is there a way to make awk use bash instead of sh when running system commands using the system() call? I want to use some bash-specific features such as [[ ]] and < > string comparison operators: ...
3
votes
1answer
26 views

How to execute as the logged-in user in a sudo script (OSX)?

Is there a way to switch contexts like that? The script in my specific case is an installer postinstall script, which requires sudo privileges only for some of the tasks and requires the logged-in ...
3
votes
1answer
130 views

clear full-screen in script and get the previous prompts after exiting script

Today I was using glance tool in my office to monitor CPU utilization.When I run glance from terminal ,the command clears the screen and after all the work when I quit back to the terminal,the ...
3
votes
1answer
950 views

How to check will my computer is going to reboot(or shutting down)?

When I send a reboot command(or shutdown) command to a Linux machine does it keeps that messages at somewhere and can I query it. I.e. I will send a reboot command and after that I will run another ...
3
votes
2answers
2k views

Difference of folders and files

I have two folders which have different folders inside. Those folders also contains different files. I am looking for the command that would give me the difference between those two parent folders. ...
3
votes
1answer
50 views

Printing short latex snippets

Is there a way to quickly (render and) print short latex snippets like single equations? Something similar to echo "Some text" | lpr like make-latex-image "$\frac{some}{equation}$" | ...
3
votes
0answers
70 views

gnu screen: automatic session on split

Inactive region appears after 'split' command in gnu screen now. You must go to the new region and type :screen. Only after that shell session appears in this region. Is it possible to make new ...
2
votes
1answer
734 views

how to get out from the command iostat on unix?

I was installing a .iso 8,2 version in a vmware to learn unix., and i am stuck with iostat command, i run iostat 3 and is keep going to show me the results, but whem i put exit or q or q! to exit, he ...
2
votes
2answers
1k views

Ignoring files that find cannnot search or open?

I searched for big files using this command on HP Unix: find . -type f -size +100000000c -exec ls -lrt {} \; The result came out somthing like this: -rw-rw-rw- 1 qa1wrk32 test 169263642 ...
2
votes
3answers
771 views

what is “play” command/package available by default in Linux Mint and how to remove it

I'm trying install play framework on Linux Mint and setup its variable: export PATH=$PATH:/relativePath/to/play But command can't run because it's being overlapped by another play command which was ...
2
votes
2answers
204 views

Tool for viewing top N items in stream

I'm looking for an existing Linux command-line tools that can accomplish the following: Consider there is an input stream /dev/inputstream which spews an infinite stream of data that looks like this: ...
2
votes
2answers
79 views

What filesystem mount point am I currently working on?

I would like to know in what filesystem mount point I am currently on, similarly to using pwd to know what directory I am in. I know you can use df . (or df $(pwd) or many variants), but I find it ...
2
votes
3answers
2k views

Why does Firefox refuse to die despite killing it with pkill -9?

I am issuing the following command to kill Firefox on my Red Hat Linux box: [subhrcho@slc04lyo ~]$ pkill -9 -f firefox [subhrcho@slc04lyo ~]$ However, when I try to invoke Firefox through ...
2
votes
4answers
697 views

What are commands to find shell keywords, built in functions and user defined functions?

I was discussing with my friend on how the commands are parsed in the shell, and he told me that bash searches the command in following order List of aliases List of shell keywords List of ...
2
votes
2answers
33 views

Is there a `--paranoid` type flag for common, potentially irreversible commands?

I'm not aware of any standard flag that is implemented. There are some git commands that let you specify a -n parameter that will show you what the command is going to do, but doesn't actually do it. ...