CS5531 Virtual Lab 2 Fall 2023
CS5531 Virtual Lab 2 Fall 2023
Fall 2023
Virtual Lab #2
Max Points: 100
Name:
1.4 Pipes
Pipes are mechanism by which the output of one program can be sent as the input to another program.
The vertical bar (|) character represents the pipe command. (ps –fe | less)
Page 1 of 3
1.5 Redirection
Through redirection (>), you can take the output of a program and have it automatically sent to a file.
To append additional data to an existing file use two > symbols (>>).
The following list shows the most common combinations of the three permissions:
Letter Permission Value
--- No permission 0
r-- Read only 4
rw- Read and write 6
rwx Read, write, and execute 7
r-x Read and execute 5
--x Execute only 1
Note: Use of File Transfer Software like WinSCP, CyberDuck, FileZilla will maker the scp easier simply
by drag and drop to/from remote/local machine.
Move Files: mv (moving a file from one directory to another or changing name of a file. Unlike
copy (cp), move (mv) command removes the original file)
Link Files: ln
Find a File: find
Locate a File: locate
Concatenate Files: cat
Display a File One Screen at a Time: more
Disk Free: df; df -kh
Disk Utilization: du
Show the Directory Location of a File: which
Locate a Command: whereis
Page 2 of 3
1.10 PROCESSES
STEP 2: ONCE YOU ARE SURE THAT ALL THE COMMANDS ARE OK
Perform and record the above Linux operations, in the given order (steps 1.1 … 1.11), in a log file using
Linux “script” command.
Directions
No late assignments will be accepted!
This work is to be done individually
The script file will have to be saved with the name lab2_yourNETID.log
You may at times use the editor gedit/emacs/vim/nano/pico etc.
Make sure that the log file content is no more than 4-5 pages (by issuing the command wc -l and
check the number of lines, typically 50 lines are there in a page)
Please make sure that the log file is pure text, there should NOT be any weird characters
In case the output of a command will be very lengthy, you may use output redirection > to temp
text file so that the log file content will be less
Assignment is due before Wednesday, September 6, 2023 by 11:59pm
On or before the due time, drop the electronic copy of your work in the Canvas
INTEGRITY CHECK
Make sure the name of the script file conforms to the naming convention as mentioned in the Lab,
i.e., it should be Lab2YourNetID.log
Make sure the log file content is NOT more than say 300 lines, i.e., 4~5 pages
Page 3 of 3