The command tag has no wiki summary.
57
votes
6answers
4k views
Why is cd not a program?
I've always wondered why cd isn't a program, but never managed to find the answer.
Anyone know why this is the case?
17
votes
2answers
448 views
What is `--` called?
Recently I got to know of -- that is double-hyphen which is used to tell a command that the option list has ended and what follows should not be considered as a option. So,
grep -- 'search_word' *
...
17
votes
2answers
503 views
What is the point of the `cd` external command?
As referenced in this fine answer, POSIX systems have an external binary cd in addition to the shell builtin. On OS X 10.8 it's /usr/bin/cd. You can't use it like the builtin cd since it exits ...
16
votes
3answers
573 views
Which are the standard commands available in every Linux system?
I would like to know which are the standard commands available in every Linux system.
For example if you get a debian/ubuntu/redhat/suse/arch/slackware etc, you will always find there commands like:
...
14
votes
2answers
681 views
How to stop the find command after first match?
Is there a way to make the find command to stop right after finding the first match?
10
votes
4answers
536 views
What is the difference between running a executable just by name and by appending a dot /slash before it?
This is the output from ls -all command :
-rwxr----- 1 subhrcho dba 3600 Nov 13 17:26 jdev
-rw-r----- 1 subhrcho dba 1566 Nov 13 17:26 jdev-Darwin.conf
-rw-r----- 1 subhrcho dba 347 Mar 6 2009 ...
9
votes
3answers
280 views
Why is dmesg called dmesg?
Is there any explanation/history behind the name of the command dmesg (which prints out some kernel messages)?
9
votes
2answers
423 views
What's the reason for this specific “rm” sequence in the xkcd joke?
Here's part of this xkcd comic strip where the idea is that the author can't write a sort program so he adds code to delete all files
system("rm -rf ./");
system("rm -rf ~/*");
system("rm -rf /");
...
8
votes
0answers
190 views
how to get exit status from the command before the last [duplicate]
I have solaris machine ( solaris 10 )
please Look on the following simple commands (haconf -makerw | grep -iq "Cluster already writable")
# haconf -makerw
VCS WARNING V-16-1-10364 Cluster ...
7
votes
2answers
2k views
How to run time on multiple commands AND write the time output to file?
I want to run time command to measure time of several commands.
What I want to do is:
Measure the time of running of all of them added together
Write the time output to a file
Write the STDERR from ...
6
votes
1answer
438 views
The “yes” command
There is a yes command in unix/linux which basically infinitely prints y to the stdout. What is the point of it, and how is it useful?
6
votes
3answers
399 views
Difference between commands in bash script and commands in terminal
Are there any differences between commands that you type into the terminal and commands you include in a script?
5
votes
2answers
228 views
Which of these three commands is telling the TRUE Redhat release information
I was checking for the Redhat release so this time I used three different commands. Two commands gave the same result but the third command gave different result. Which one is right.
...
5
votes
2answers
117 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
2answers
1k views
Execute command in remote active terminal
Suppose you have a terminal emulator (T1) open with a PID of 6350.
From another terminal, type this command (C1):
echo "ls\n" > /proc/6350/fd/0
This writes ls and the new line in T1 but does ...
4
votes
3answers
216 views
Linux Rename File Beginning with “--” [duplicate]
Possible Duplicate:
How do I delete a file whose name begins with “-” (hyphen a.k.a. dash or minus)?
This is an awkward one, I have received some files from a windows machine ...
4
votes
2answers
335 views
Why doesn't ln -s tell that it fails when creating a symlink to an existing symlinked directory?
When running (on linux different ubuntu variations):
>ln -s dir_1 symlink_dir
>ln -s dir_2 symlink_dir
It fails without telling that it fails. But if you do the same thing on a file instead ...
4
votes
3answers
217 views
Test command in unix doesn't print an output
When I type this in the terminal
test 4 -lt 6
I don't get any output. Why not? I need that 0 or 1
4
votes
6answers
510 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?
4
votes
5answers
254 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
1answer
220 views
What does <defunct> mean in the output of ps?
I had issued the ps -ef|grep java command and this is one of the entries that I got :
subhrcho 875 803 0 Jan23 pts/5 00:02:27 [java] <defunct>
What is <defunct> implying here ? ...
4
votes
1answer
260 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 ...
3
votes
2answers
496 views
What's the difference between “dir” and “ls”?
I have compared the man pages of dir and ls and they seem to be exactly the same. Both are part of GNU coreutils and "list directory contents".
The only difference I've seen so far is that dir ...
3
votes
4answers
232 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 ...
3
votes
1answer
219 views
What is the use of literal command in ftp?
Browsing through FTP help (i.e. ftp> ?), showed me a command name literal, description of which is
ftp> ? literal
literal Send arbitrary ftp command
I tried to do some trial and ...
3
votes
3answers
38 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
...
3
votes
3answers
569 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):
...
3
votes
3answers
251 views
Get a list of 3 letter commands on Mac OS X
How can I either create or find a list of 3-letter unix commands on Mac OS X?
I'd like to create a new program/command for a project. I'd like to make it a 3-letter name, but I don't want to conflict ...
3
votes
1answer
158 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
2answers
605 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
3
votes
3answers
767 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
2answers
145 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
1answer
143 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 ...
3
votes
2answers
91 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
368 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
442 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
39 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
119 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
1answer
350 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
0answers
33 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
2answers
2k views
In UNIX, how to find the most commonly used commands in history of unix?
In UNIX, how to find the most commonly used commands in history?
2
votes
1answer
297 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
433 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
138 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
1answer
269 views
Git auto-complete
I am using Git as many of you do. Also, I don't use any GUI for that — just CLI. So I was wondering: are there any way to make Git commands (git status, git checkout etc.) complete themselves when ...
2
votes
1answer
202 views
Computer speed in flops
Nowdays, The speed of supercomputers are measured in Flops. Is there any linux command or tool that can calculate or gives the speed of a processor in Flops. If not, than how do we measure it.
2
votes
3answers
158 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
1answer
88 views
Is there a command that outputs a line-numbered file starting the numbering at a specific line?
cat -n file outputs file with line numbering, but how can I specify at which line to start the numbering? Is there a command that can do that?
I've thought of perhaps splitting the process into a few ...
2
votes
1answer
85 views
Equivalent of pick command in linux
OS: Linux Mint 14
Is there an equivalent of the pick command available in Linux? Pick command is the one where for each given argument, it asks yes/no and prints the selection to stdout. This script ...
2
votes
2answers
211 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. ...
