Академический Документы
Профессиональный Документы
Культура Документы
IN UNIX execute
/usr/bin/tcsh
/usr/bin/sh
/usr/bin/csh
Type ps to see which shells are active.
You change your shell with the command exec csh.
you use the csh shell instead of the current one
Type ps to see that you changed your shell)
3. Try grep commands in UNIX and Linux to get used to using flags such as
{-i, -n} and other constructs. You can use multiple flags for the same command
Grep command selects and prints the lines from a file which matches the given string.
grep <pattern> *
grep "pattern" *
grep -n <pattern> <file>: the -n flag will output the line number as well
as the pattern in the file
LINUX:
4) Use a pipe and the tee command (these are valid in all three
environments)
tee saves intermediate results in a file, for example:
grep cd * | tee temp | wc
will place the occurrences of cd inside temp and print the word count
of temp on the terminal.
Output the temp file.
The above will pipe the output of the help (man) file one page at a time to
the
terminal. DO NOT PRINT THIS FILE OUT.
firstscript
Now try it with spaces in the parameters, i.e., hello Dr. Levine
You'll see that UNIX terminates input upon finding a blank, such as when
you execute
.Levine
three
echo
echo
echo
one line of data with parameters in the file and execute the file with
3 parameters:
echo $1 $2 $3
7) You are going to create another small shell script called secondscript.
Choose one of your existing files in the current directory (say child.c)
and write that name into secondscript for compilation and execution:
rm ./a.out
cc ./child.c
./a.out &
Ps
8)
In UNIX or Linux write a shell script for creating a copy of a given
(nonempty)
file, where the copy has each line numbered. Do this by
printing out the file with a line number (cat -n) and redirecting it
to another filename.
cat -n "filename" > newfile
Then print out the new file on the terminal.
Don't forget that you must specify the path in our Linux system, but not
in our UNIX environment. (the path includes your current directory)
A Linux-based system is a modular Unix-like operating system. It derives much of its basic design from
principles established in Unix. Such a system uses a monolithic kernel, the Linux kernel, which handles
process control, networking, and peripheral and file system access. Device drivers are either integrated
directly with the kernel or added as modules loaded while the system is running.
Separate projects that interface with the kernel provide much of the system's higher-level functionality.
The GNU user land is an important part of most Linux-based systems, providing the most common
implementation of the C library, a popular CLI shell, and many of the common Unix tools which carry out
many basic operating system tasks.
The best feature of Linux Framework is its low susceptibility to virus and malware infestation. Linux is
almost always a free operating system with multiple sources distribution. In contrast, Windows and Mac
OS X are some of the most expensive operating systems available. Linux is an open source platforms
with plenty of developers working on applications, functions, features and add-ons that are guaranteed to
improve your user experience.
.