Question: Objective: The objective of this lab is to work with files of UNIX file system. Procedure: 1. Open your Unix shell and try these commands:

Objective: The objective of this lab is to work with files of UNIX file system. Procedure: 1. Open your Unix shell and try these commands: Create a new file and add some text in it (1) cat > filename View a file cat /etc/passwd more /etc/passwd more filename (0.5) > Copy file, making file2 cp filel file2 Move/rename filel as file2 mv filel file2 (0.5) >Delete filel as file2 (0.5) rm file rm -i file first // Delete file // Double-check > Counts the lines, words, characters in file (0.5) wc file (1) // List lines grep lubuntu /etc/passwd containing "lubuntu' in /etc/passwd //Lines grep 'else /etc/profile containing else in /etc/profile //Lines grep united-/myFile starting with 'united'in -/myFile > Output can be redirected to a file with> (1) ols > dir.txt cal 1997 > year 1997 > Output can be redirected to a file with>'(1) Is > dir.txt cal 1997 > year 1997 > Output can be appended to a file with '>> (1) cal 1997 > years *cal 1998 >> years (1) > Concatenate two files - cat fi f2 > fs > Input redirection (less common) uses ' Combine input and output redirection (1) * wc year-counts
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
