-
Notifications
You must be signed in to change notification settings - Fork 0
/
LabA_AK.sh
38 lines (28 loc) · 900 Bytes
/
LabA_AK.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#Print the working directory and look at the files within the directory
pwd
ls -l
#Create a text file than copy it
nano draft.txt
cp draft.txt draft2.txt
#Make a new directory and move one copy of the text file into this directory
mkdir Unix_Files
mv draft.txt Unix_Files/
#Check that the file is in the new directory
cd Unix_Files
ls
#Change permissions on the file so that all other users cannot read it
chmod o-r draft.txt
#Go back to the original directory and remove the copied file
cd ..
rm draft2.txt
#Create a new text file, then move it to the secondary directory
nano words.txt
mv words.txt Unix_Files/
#Move to the secondary directory and concatenate the two text files
cd Unix_Files/
cat draft.txt words.txt > combo.txt
#Look at the first and last lines of the text file
head -1 combo.txt
tail -1 combo.txt
#Count the number of lines without the letter 'a'
grep -ci a combo.txt