Question: Linux terminals What is the token from running the ls command? What is the token from running the foo command What is the token from
Linux terminals
What is the token from running the ls command?
What is the token from running the foo command
What is the token from running the ls -ahtl command?
The prompt
There are four key components to a standard Linux prompt [username]@[computername]:[path][$] In our lab we are logged in as the user Linux and our computer's name is commandline-intro, ~. This indicates we are in our home directory, and the $ symbol indicates we are a non-root or admin user. If we were to change directory, you would see the path section change to reflect our new location. If we were logged in as the root user, the prompt would end in a # and the username portion of the prompt would change to root.
Entering commands
Commands are entered on a single line and executed with the return or enter key. Once the command completes, the output is returned to the user. Each command may have a different way of formatting the data on the screen. If you try to run a command that doesnt exist or there is an error in your command, the terminal should display an error message. Below are some examples you can run in the CLI to show examples of good and bad commands with their output. You can also enter commands in the terminal yourself at any time. Good command example: ls
Bad command example: foo
Below is an example using ls and foo and the expected outputs.
root@IML_Labs:/# ls bin etc home media opt run sys tmp boot file1.txt lib mnt proc sbin test_directory usr dev file2 lib64 newdirectory root srv test_file.csv var root@IML_Labs:/# foo bash: foo: command not found root@IML_Labs:/#
Enter ls -ahtl into the terminal. This command shows owners, file permissions and file size as well as the files listed in the directory. Below is an example of how ls -ahtl is used and what the output looks like.
-rw-r--r-- 1 root root 0 May 20 09:09 test_file.csv -rw-r--r-- 1 root root 0 May 20 09:09 file2 -rw-r--r-- 1 root root 0 May 20 09:09 file1.txt drwxr-xr-x 2 root root 4.0K May 20 09:08 test_directory drwxr-xr-x 2 root root 4.0K May 20 09:08 newdirectory drwxr-xr-x 5 root root 360 May 20 09:07 dev dr-xr-xr-x 13 root root 0 May 20 09:07 sys dr-xr-xr-x 325 root root 0 May 20 09:07 proc -rwxr-xr-x 1 root root 0 May 20 09:07 .dockerenv drwxr-xr-x 1 root root 4.0K May 20 09:07 etc drwxr-xr-x 1 root root 4.0K May 10 2018 home drwxr-xr-x 1 root root 4.0K May 10 2018 run drwxr-xr-x 1 root root 4.0K May 10 2018 lib drwxr-xr-x 1 root root 4.0K May 10 2018 bin drwxr-xr-x 1 root root 4.0K May 10 2018 sbin drwxr-xr-x 1 root root 4.0K May 10 2018 lib64 drwxr-xr-x 1 root root 4.0K Apr 10 2018 var drwxr-xr-x 2 root root 4.0K Apr 10 2018 media drwxr-xr-x 2 root root 4.0K Apr 10 2018 mnt drwxr-xr-x 2 root root 4.0K Apr 10 2018 opt drwxr-xr-x 2 root root 4.0K Apr 10 2018 srv drwxr-xr-x 1 root root 4.0K Apr 10 2018 usr drwxr-xr-x 2 root root 4.0K Apr 9 2018 boot root@IML_Labs:/#
00:03
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
