From the man page for ps:
-a Select all processes except both session leaders (see getsid(2)) and
processes not associated with a terminal.
-f Do full-format listing. This option can be combined
with many other UNIX-style options to add additional
columns. It also causes the command arguments to be
printed. When used with -L, the NLWP (number of
threads) and LWP (thread ID) columns will be added. See
the c option, the format keyword args, and the format
keyword comm.
-e Select all processes. Identical to -A.
grep is used to print lines matching a pattern
.
What it does
The command
ps -aef | grep `pwd`
prints out all the lines matching the output of the command pwd
(which will be the path your current working directory), from the output of ps -aef
.
e.g:
saji@geeklap:~$ pwd
/home/saji
saji@geeklap:~$ ps -aef | grep `pwd`
saji 2854 2814 0 09:51 ? 00:00:00 /usr/bin/ssh-agent /usr/bin/gpg-agent --daemon --sh --write-env-file=/home/saji/.gnupg/gpg-agent-info-geeklap /usr/bin/dbus-launch --exit-with-session gnome-session --session=ubuntu
saji 2855 2814 0 09:51 ? 00:00:00 /usr/bin/gpg-agent --daemon --sh --write-env-file=/home/saji/.gnupg/gpg-agent-info-geeklap /usr/bin/dbus-launch --exit-with-session gnome-session --session=ubuntu
saji 2879 1 0 09:51 ? 00:00:00 /usr/lib/gvfs//gvfs-fuse-daemon -f /home/saji/.gvfs
saji 14242 14148 0 15:26 pts/7 00:00:00 grep --color=auto /home/saji
As you can see the output shows the lines matching my current working directory, which is /home/saji
.
Background info:
If a command is in $(...) or ...
, then the command is run and the output (what is printed to the screen) is caught and substituted to where the original $() or `` string was. So the actual command run is grep pwd.
For more information refer this link.(Thanks to @minerz029 for this information).
Do check out the following link for a detailed technical answer from the man pages itself:
http://explainshell.com/explain?cmd=ps+-aef+|+grep+%60pwd%60
Your question
What gcc -o sample sample.c
actually does
The command you have pasted triggers gcc
to compile sample.c
.
As a result you'll get an output/executable with the same sample
.
The parameters (as -o in your example which defined the name of the output file ) are explained in the man page of gcc.
You can open it by running man gcc
I am quoting the -o
section of the man page here
-o file
Place output in file file. This applies to whatever sort of output
is being produced, whether it be an executable file, an object
file, an assembler file or preprocessed C code.
If -o is not specified, the default is to put an executable file in
a.out, the object file for source.suffix in source.o, its assembler
file in source.s, a precompiled header file in source.suffix.gch,
and all preprocessed C source on standard output.
In General
Wikipedia explains a good amount of gcc here.
I am quoting only the start - but the complete article is worth a read and offers a lot of additional links and references
The GNU Compiler Collection (GCC) is a compiler system produced by the
GNU Project supporting various programming languages. GCC is a key
component of the GNU toolchain. The Free Software Foundation (FSF)
distributes GCC under the GNU General Public License (GNU GPL). GCC
has played an important role in the growth of free software, as both a
tool and an example.
Originally named the GNU C Compiler, when it only handled the C
programming language, GCC 1.0 was released in 1987. It was extended
to compile C++ in December of that year. Front ends were later
developed for Objective-C, Objective-C++, Fortran, Java, Ada, and Go
among others.
GCC has been ported to a wide variety of processor architectures, and
is widely deployed as a tool in the development of both free and
proprietary software. GCC is also available for most embedded
platforms,[citation needed] including Symbian (called gcce), AMCC,
and Freescale Power Architecture-based chips. The compiler can
target a wide variety of platforms, including video game consoles such
as the PlayStation 2 and Dreamcast.
As well as being the official compiler of the GNU operating system,
GCC has been adopted as the standard compiler by many other modern
Unix-like computer operating systems, including Linux and the BSD
family, although FreeBSD and OS X have moved to the LLVM system.
Versions are also available for Microsoft Windows and other operating
systems; GCC can compile code for Android and iOS.
Best Answer
The message is from your job, not from
at
(andat
also does not have a-w
option BTW). By default,at
sends STDOUT and STDERR from any job via mail, unless specified otherwise.Presumably, your job was a
iptables
task -- based on the message regardingxtables
. And the-w
(--wait
) option ofiptables
waits for thextables
lock to be released, as suggested in the message.