Name: Muhammad Danial Bin Zainal Azlan Matric Number: 192020173
Part 1
1.use sudo nano .bashrc to open .bashrc file
2.You can see the default aliases and if statement codings. You can create your own aliases if you want. In this lab ,we will just learn how to add the export PS1 command in the .bashrc.
So go to the last line coding .Below that add "export PS1="/h /u /w /$ " and save it.
3.To load the saved .bashrc file in the terminal type " . .bashrc " and press Enter.
4. Now you can see the PS1 is changed.
6.And remove the export PS1="\h \u \w \$ " and save it.
7.Use . .bashrc to load again the .bashrc in the terminal.
2. Now run it again, but enclose the filename in quotes: ls -la "file with blanks.txt"; it will work properly now
3. Enter "ls -la file" and press Tab. It will escape the blanks for you.
4. Run ls -la special>.txt. Observe the error.
2. It should succeed. Run the following command: echo $?
PART 4
For kali linux users: make sure you have created an empty file named file1.txt in home directory.
1. Enter ifconfig > file1.txt. You won't see anything, because the output went into the file.
3. This works the other direction as well, to read from a file run the following command:
sort < file1.txt
We show how to send the output from one terminal to another in the following steps:
1. In one terminal run the tty command. The output should be something like /dev/ pts/0
2. In the other terminal run the route command. You will see the output in that terminal.
3. Now run route again, but now using the command:
route > /dev/pts/0
4. The output will go to that other terminal.
0 Comments