In: Computer Science
*. To execute the script CS50_hw_session04b . give it executable
permission by typing
chmod +x CS50_hw_session04b
then you can execute it by typing
./CS50_hw_session04b
or you can execute the sript
sh CS50_hw_session04b
or
bash CS50_hw_session04b
Now change directory into CS50_hw_session04 which is in the home directory
cd ~/CS50_hw_session04
type command
ls
to see the files in the directory. you can see file_1 and
file_2
- to execute file_1 type
bash
file_1
- to read the file_2 you can use commands 'cat' or 'less'
cat file_2
or
less file_2
- to create dir_3 ,type
mkdir dir_3
for the rest of the task type
whoami >dir_3/name
bash file_1
>>dir_3/name
- type command
date > dir_3/now
cat file_2 >>dir_3/now
- type commands
date > jamesbond
chmod 007 jamesbond
- type commands
date > myfriend
chmod 750
- type theses commands
--
echo "first
name" >session_04b_hw
--
ls -l
--
cat
dir_3/name
--
cat
dir_3/now
--
echo "The
permission of jamesbond is $(stat -c "%a" jamesbond) " >>
session_04b_hw