Lab 1_Linux_Shell_Commands (3)
Lab 1_Linux_Shell_Commands (3)
LINUX SHELL
PROGRAMMING
Operating System Lab
Introduction
2
To copy a file : cp
Copy source to destination or multiple sources to
directory
-i [prompt before overwrite]
‐u [copy only when the src file is newer than the dest
file or when the dest file is missing]
File Operations (Cont.)
9
‐u [move only when the src file is newer than the dest
file or when the dest file is missing]
‐v [explain what is being done]
Directory and File Listings
11
To create Link
By setting the variable ibase to 2 and obase to 16 all input that is supplied
is taken as binary whereas all output is displayed in hexadecimal.
A Bit of Mathematics (Cont.)
23
Input redirection:
< ‐get input from file instead of the keyboard
Output redirection:
> ‐send output to file instead of the terminal window
Append output:
>> ‐command is used to append to a file if it already
exists
Redirection (Cont.)
28
Example:
Calender
29