In: Computer Science
Given the Linux shell command descriptions, please write down the corresponding shell commands in a terminal window.
a) list the current directory contents with the long format
b) print the name of the working directory
c) change directory to the root directory
d) change the permissions of file "myfile" (owned by yourself) so that (1)you can read/write, but cannot execute; (2) all other users cannot read/write/execute this file.
e) make a new directory called “mydir”
Solution:-
a) To list the current directory current type ls in the Linux terminal and press Enter
b) To print the name of the working directory, type: pwd (in LINUX TERMINAL) and press Enter
c) To change directory to root directory, use cd ~ OR cd.
d) To change directory permissions in Linux, use the following:
Note that “r” is for read, “w” is for write, and “x” is for execute.
e) We use the command 'mkdir' to create new directories.
For this, we need to run 'mkdir mydir'